[Bug 16826] New: Add API routes for getting item availability and holdability
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Bug ID: 16826 Summary: Add API routes for getting item availability and holdability Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Web services Assignee: koha-bugs@lists.koha-community.org Reporter: larit@student.uef.fi QA Contact: testopia@bugs.koha-community.org Add API routes for getting item availability and holdability. Holdability check requires a target borrower (either user himself or borrowernumber). I'm thinking of following endpoints: GET /api/v1/items/{itemnumber}/availability GET /api/v1/items/{itemnumber}/holdability For myself GET /api/v1/items/{itemnumber}/holdability?borrowernumber=X For X Terms: - availability: Does not require login or permissions. Makes a simple check if item is in a valid state for holdings. In other words, check "notforloan", "onloan", "itemlost", "withdrawn", "damaged". - holdability: Requires login and also catalogue permission if the request is made for another borrowernumber than myself. Item is holdable if it is available and if it satisfies IsAvailableForItemLevelRequest and CanItemBeReserved in C4::Reserves + (also debarments and fines?) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |16825, 13903 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 [Bug 13903] Add API routes to list, create, update, delete holds https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16825 [Bug 16825] Add API route for getting an item -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jiří Kozlovský <mail@jkozlovsky.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com, | |josef.moravec@gmail.com, | |mail@jkozlovsky.cz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion --- Comment #1 from Lari Taskula <larit@student.uef.fi> --- After thinking this issue further and researching other availability definitions that we have in Koha, I think the above definition of availability is confusing and misleading, and routes are not good. Availability is more broad term than what described in the first post, for example item can be available for in-house use but not for checkouts, and by using these routes, this kind of information should also be presented. I'm open to ideas :) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #2 from Jiří Kozlovský <mail@jkozlovsky.cz> --- How about returning JSON with all the values possible? Let's say for availability: { in_house: true, checkout: false } -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #3 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53271&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 item availability. The route does not require login and does not consider patron status, as its purpose is to be fast and efficient in checking general availability of item(s), much like in a typical search. Because of this, this route does not tell us whether item is holdable or available for checkout for a specific patron. Patron-specific availability will be introduced in another patch. For this route, item is NOT available if: - item on loan, - item reserved, - item withdrawn, - item lost, - item restricted, - item or itemtype not for loan Depending on system preference, item may or may not be available: - item damaged (depending on AllowHoldsOnDamagedItems), The returned information is some necessary item information combined with: - available (bool) - availability_description ((array of strings) reasons for possible restrictions to availability, such as ["notforloan"]) - hold_queue_length (int) - expected_available ((string) due date if onloan) Possible values in availability_description are an empty array and any of: "onloan", "reserved", "damaged", "withdrawn", "itemlost", "restricted", "notforloan", "ordered" Patch adds $item->get_availability() in Koha::Items and introduces a new Koha::Item::Availability class where we can store item-related availability information. Includes REST tests and unit tests for new subroutines in Koha::Item and Koha::Item::Availability. 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 status is as described in the patch description above. Also make sure reasons for unavailability are in availability_description. 4. Repeat steps 1-3 until you are confident 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #4 from Lari Taskula <larit@student.uef.fi> --- (In reply to Jiří Kozlovský from comment #2)
How about returning JSON with all the values possible?
Let's say for availability: { in_house: true, checkout: false } I think this is a good option for showing different types of availabilities.
Anyway, to start pushing this feature forward, I wanted to upload a patch containing my current progress. It has the problem that I was thinking about earlier. For example the patch above considers an item with "notforloan" status as unavailable, while it could still be for reading room use. Btw, is this the definition of in-house use? Also, what other cases should we consider? I could modify this patch to better inform the different types of availabilities. Before that, it would be great to have input from others as well :) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53271|0 |1 is obsolete| | --- Comment #5 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53276 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53276&action=edit Bug 16826: Add API route for getting item availability -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #6 from Lari Taskula <larit@student.uef.fi> --- How about something like this for general/anonymous availability? GET /availability/items?itemnumber=2225 returns for example: [{ "barcode":"TEST000002", "biblioitemnumber":"629", "biblionumber":"629", "checkout": { "available":false, "description":["notforloan","reserved"], "expected_available":null }, "hold_queue_length":1, "holdingbranch":"CPL", "homebranch":"FFL", "itemcallnumber":"782.42166092", "itemnumber":"2225", "local_use": { "available":false, "description":["reserved"], "expected_available":null }, "location":"some_location", "onsite_checkout": { "available":false, "description":["onsite_checkouts_disabled"], "expected_available":null } }] ((+add hold-availability) In this example local_use = checkout with ignoring notforloan, and onsite_checkout = OnSiteCheckouts syspref ? (local_use ? true:false):false) Anyway, what about when checking availability for a specific patron? Is it better to use the same route or use a completely different route? The reason I consider separation between anonymous availability and logged-in availability is my fear that this endpoint will be super busy, and availability for a specific patron is probably a heavy operation. On the other hand, if I used this route, I think I would just want one route with always giving me the correct availability status (checkout, hold, local_use, onsite_checkout etc) for an item, regardless of me being logged-in or not. Opinions are welcome. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53276|0 |1 is obsolete| | --- Comment #7 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53371&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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #8 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53672 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53672&action=edit Bug 16826: Add API route for getting item availability Fixed tests. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53371|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53672|0 |1 is obsolete| | --- Comment #9 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53675&action=edit Bug 16826: Add API route for getting item availability Updates documentation for Koha::Item::Availability. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53675|0 |1 is obsolete| | --- Comment #10 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53813&action=edit Bug 16826: Add API route for getting item availability Reverts some small unintended changes (unneccessary e.g. line breaks) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jiří Kozlovský <mail@jkozlovsky.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=13927 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #11 from Jiří Kozlovský <mail@jkozlovsky.cz> --- It works for me so far. Are you going to do any further changes to this bug or you are willing to mark it as Needs Signoff? All tests passed for me, so I could sign this off. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #12 from Jiří Kozlovský <mail@jkozlovsky.cz> --- How about returning the due_date of current checkout so that user can create better idea when it'll be available for him? I know you already include "expected_available", which is nice, but when there is also a hold on checkedout item, there is empty value in it. What do you think? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
It works for me so far. Are you going to do any further changes to this bug or you are willing to mark it as Needs Signoff? I could mark it as Needs Signoff, maybe it will initiate some more interest on
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #13 from Lari Taskula <larit@student.uef.fi> --- (In reply to Jiří Kozlovský from comment #11) this :) (In reply to Jiří Kozlovský from comment #12)
I know you already include "expected_available", which is nice, but when there is also a hold on checkedout item, there is empty value in it. Thanks Jiří, good catch! Updating the patch to fix this.
-- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53813|0 |1 is obsolete| | --- Comment #14 from Lari Taskula <larit@student.uef.fi> --- Created attachment 53826 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53826&action=edit Bug 16826: Add API route for getting item availability Fixes missing "expected_available" from checkout-availability if the item has holds. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jiri Kozlovsky <mail@jkozlovsky.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jiri Kozlovsky <mail@jkozlovsky.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53826|0 |1 is obsolete| | --- Comment #15 from Jiri Kozlovsky <mail@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@jkozlovsky.cz> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #16 from Jiri Kozlovsky <mail@jkozlovsky.cz> --- (In reply to Lari Taskula from comment #14)
Created attachment 53826 [details] [review] Bug 16826: Add API route for getting item availability
Fixes missing "expected_available" from checkout-availability if the item has holds.
Now it works as expected, nice job! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #17 from Jiri Kozlovsky <mail@jkozlovsky.cz> --- Created attachment 53922 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53922&action=edit Bug 16826: [QA Follow-up] Add 'new_status' to Swagger definition Adds missing "new_status" to item's Swagger definition. Also, to avoid forgotten columns in definitions, adds a test to compare item-definition to database's items-table. To test: 1. Run t/db_dependent/api/v1/items.t Signed-off-by: Jiri Kozlovsky <mail@jkozlovsky.cz> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jiri Kozlovsky <mail@jkozlovsky.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53922|0 |1 is obsolete| | --- Comment #18 from Jiri Kozlovsky <mail@jkozlovsky.cz> --- Comment on attachment 53922 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53922 Bug 16826: [QA Follow-up] Add 'new_status' to Swagger definition Sorry about this patch, I've messed up bug id - had to be 16825 instead of 16826. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53827|0 |1 is obsolete| | --- Comment #19 from Lari Taskula <larit@student.uef.fi> --- Created attachment 54053 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54053&action=edit Bug 16826: Add API route for getting item availability Signed-off-by: Jiri Kozlovsky <mail@jkozlovsky.cz> Fixed small mistakes in documentation and removed itemnumberPathParam from Swagger; it belongs to Bug 16825. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16652 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16652 [Bug 16652] Omnibus: RestfulAPI supporting services for Vufind and for xnciptoolkit drivers -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add API routes for getting |REST API: Add API routes |item availability and |for getting item |holdability |availability and | |holdability -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |larit@student.uef.fi |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54053|0 |1 is obsolete| | --- Comment #20 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 56128 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56128&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. Apply patch and run minifySwagger.pl perl misc/devel/minifySwagger.pl -s api/v1/swagger/swagger.json -d api/v1/swagger 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 1-3 until you are confident the route works as expected. 6. 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@jkozlovsky.cz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #21 from Lari Taskula <lari.taskula@jns.fi> --- Rebased on top of master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56128|0 |1 is obsolete| | --- Comment #22 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 56129 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56129&action=edit Bug 16826: Add API route for getting item availability Fixing typo in test plan. This plan applies: To test: 1. Apply patch and run minifySwagger.pl perl misc/devel/minifySwagger.pl -s api/v1/swagger/swagger.json -d api/v1/swagger 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 2-4 until you are confident the route works as expected. 6. 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@jkozlovsky.cz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56129|0 |1 is obsolete| | --- Comment #23 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 56130 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56130&action=edit Bug 16826: Add API route for getting item availability Fixing one more typo in test plan: To test: 1. Apply patch and run minifySwagger.pl perl misc/devel/minifySwagger.pl -s api/v1/swagger/swagger.json -d api/v1/swagger/swagger.min.json 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 2-4 until you are confident the route works as expected. 6. 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@jkozlovsky.cz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56130|0 |1 is obsolete| | --- Comment #24 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 56295 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56295&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. Apply patch 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 2-4 until you are confident the route works as expected. 6. 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@jkozlovsky.cz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #25 from Lari Taskula <lari.taskula@jns.fi> --- Removed minifying step from test plan after Bug 17432 was pushed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56295|0 |1 is obsolete| | --- Comment #26 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57271&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. Apply patch 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 2-4 until you are confident the route works as expected. 6. 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@jkozlovsky.cz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57271|0 |1 is obsolete| | --- Comment #27 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57321 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57321&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. Apply patch 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 2-4 until you are confident the route works as expected. 6. 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@jkozlovsky.cz> Fixed a bug in finding existing holds. Added some more tests to cover it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57321|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #28 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57369&action=edit Bug 16826: Add Koha::Item::Availabilit(y/ies) for item availability This patch adds classes for calculating and storing item availability information. Usage is simple, e.g. holdability; my $item = Koha::Items->find(123); my $holdability = $item->availabilities->hold; if ($holdability->available) { # available for hold! } else { # $holdability->description holds the reason for unavailability } To test: 1. Run t/db_dependent/Koha/Item/Availability.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #29 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57370&action=edit Bug 16826: Add REST endpoint for displaying item availabilities 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. Apply patch 2. Play around with an item. Place a hold on it, checkout, set it damaged etc. 3. 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. 4. Check that the availability statuses are correct and that availability description lists the appropriate status for unavailability. 5. Repeat steps 2-4 until you are confident the route works as expected. 6. Run t/db_dependent/api/v1/availability.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #30 from Lari Taskula <lari.taskula@jns.fi> --- I fixed some bugs that I found during testing, and also thought the old patch should be split into two; first for introducing new classes and the second for API. I hope this makes it a bit more understandable and easier to test. All availability logic was moved from Koha::Item to Koha::Item::Availabilities. I think this way is cleaner and we avoided previously added 170 lines of code from Koha::Item that could (and should) as well be in its own module. I left a simple link into Koha::Item, $item->availabilities that you can easily use for accessing availability data. Another way is to create a new Koha::Item::Availabilities object and passing $item for the constructor. Also I added some useful item data in return JSON. Since these updates changed a lot, I set this Bug back into Needs Signoff status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57370|0 |1 is obsolete| | --- Comment #31 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57371&action=edit Bug 16826: Add REST endpoint for displaying item availabilities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57371|0 |1 is obsolete| | --- Comment #32 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57373 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57373&action=edit Bug 16826: Add REST endpoint for displaying item availabilities Include missing Swagger spec files. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57373|0 |1 is obsolete| | --- Comment #33 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 57382 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57382&action=edit Bug 16826: Add REST endpoint for displaying item availabilities Include missing Swagger spec files part 2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #34 from Lari Taskula <lari.taskula@jns.fi> --- Checks for circulation rules and patron status will be delivered in follow-ups asap. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17712 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17712 [Bug 17712] Move availability calculation to the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #35 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 58456 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58456&action=edit Bug 16826: Availability Swagger definitions GET /availability/biblio/hold GET /availability/biblio/search GET /availability/item/checkout GET /availability/item/hold GET /availability/item/search -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #36 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 58457 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58457&action=edit Bug 16826: Swaggerize Koha::Availability objects Koha::Biblio::Availability->swaggerize Koha::Item::Availability->swaggerize Constructs a HASHref that contains all availability data to be returned in a JSON object. Numifies numbers to be numbers instead of strings. E.g. biblio swaggerize { "biblionumber": 1234, "availability": { "available": true, "notes": { "Patron::SomethingToNote": { "cool": 1 } } }, "item_availabilities": [ { "itemnumber": 5678, "availability": { "available": false, "unavailabilities": { "Item::Withdrawn": {} } } } ] } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|13903 |17712 Blocks|17712 | Status|ASSIGNED |In Discussion Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 [Bug 13903] Add API routes to list, create, update, delete holds https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17712 [Bug 17712] Move availability calculation to the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57369|0 |1 is obsolete| | Attachment #57382|0 |1 is obsolete| | --- Comment #37 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 58458 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58458&action=edit Bug 16826: Controllers for availability -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #38 from Lari Taskula <lari.taskula@jns.fi> --- I added Bug 17712 as a dependency and attached new patches that use Koha::Availabiltiy to provide more detailed availability answer via REST API. I also marked the old patches obsolete. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58456|0 |1 is obsolete| | --- Comment #39 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60155&action=edit Bug 16826: Availability Swagger definitions GET /availability/biblio/hold GET /availability/biblio/search GET /availability/item/checkout GET /availability/item/hold GET /availability/item/search -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58457|0 |1 is obsolete| | --- Comment #40 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60156&action=edit Bug 16826: Swaggerize Koha::Availability objects Koha::Biblio::Availability->swaggerize Koha::Item::Availability->swaggerize Constructs a HASHref that contains all availability data to be returned in a JSON object. Numifies numbers to be numbers instead of strings. E.g. biblio swaggerize { "biblionumber": 1234, "availability": { "available": true, "notes": { "Patron::SomethingToNote": { "cool": 1 } } }, "item_availabilities": [ { "itemnumber": 5678, "availability": { "available": false, "unavailabilities": { "Item::Withdrawn": {} } } } ] } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58458|0 |1 is obsolete| | --- Comment #41 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60157 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60157&action=edit Bug 16826: Controllers for availability -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18103 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18103 [Bug 18103] REST API: Add endpoint for patron status / blocks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60157|0 |1 is obsolete| | --- Comment #42 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60218&action=edit Bug 16826: Controllers for availability GET /availability/biblio/hold GET /availability/biblio/search GET /availability/item/checkout GET /availability/item/hold GET /availability/item/search Includes API tests. To test: 1. prove t/db_dependent/api/v1/availability.t 2. Use Swagger-UI or make direct GET requests to specified availability endpoints, and make sure the returned data looks ok. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60218|0 |1 is obsolete| | --- Comment #43 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60219&action=edit Bug 16826: Controllers for availability GET /availability/biblio/hold GET /availability/biblio/search GET /availability/item/checkout GET /availability/item/hold GET /availability/item/search Includes API tests. To test: 1. prove t/db_dependent/api/v1/availability.t 2. Use Swagger-UI or make direct GET requests to specified availability endpoints, and make sure the returned data looks ok. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60155|0 |1 is obsolete| | --- Comment #44 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60267&action=edit Bug 16826: Availability Swagger definitions GET /availability/biblio/hold GET /availability/biblio/search GET /availability/item/checkout GET /availability/item/hold GET /availability/item/search -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60156|0 |1 is obsolete| | --- Comment #45 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60268 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60268&action=edit Bug 16826: Swaggerize Koha::Availability objects Koha::Biblio::Availability->swaggerize Koha::Item::Availability->swaggerize Constructs a HASHref that contains all availability data to be returned in a JSON object. Numifies numbers to be numbers instead of strings. E.g. biblio swaggerize { "biblionumber": 1234, "availability": { "available": true, "notes": { "Patron::SomethingToNote": { "cool": 1 } } }, "item_availabilities": [ { "itemnumber": 5678, "availability": { "available": false, "unavailabilities": { "Item::Withdrawn": {} } } } ] } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60219|0 |1 is obsolete| | --- Comment #46 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 60269 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60269&action=edit Bug 16826: Controllers for availability GET /availability/biblio/hold GET /availability/biblio/search GET /availability/item/checkout GET /availability/item/hold GET /availability/item/search Includes API tests. To test: 1. prove t/db_dependent/api/v1/availability.t 2. Use Swagger-UI or make direct GET requests to specified availability endpoints, and make sure the returned data looks ok. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #47 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 62727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62727&action=edit Bug 16826: (follow-up, squashable) Remove warnings Squash to Swaggerize Koha::Availability objects -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jiri Kozlovsky <mail@jkozlovsky.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #48 from Jiri Kozlovsky <mail@jkozlovsky.cz> --- Changing this to Needs Sign-off (I can see no discussion in here) Btw Lari, nice job ! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #49 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I don't agree with the proposed endpoints layout. I belive we should have /items/{item_id}/availability instead. The ->swaggerize methods aren't needed anymore as Koha::Object(s) implement the TO_JSON method with similar behaviour. This was obviously written before the TO_JSON addition. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Web services |REST api CC| |jonathan.druart@bugs.koha-c | |ommunity.org QA Contact|testopia@bugs.koha-communit | |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #50 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #49)
I don't agree with the proposed endpoints layout. I belive we should have /items/{item_id}/availability instead.
The ->swaggerize methods aren't needed anymore as Koha::Object(s) implement the TO_JSON method with similar behaviour. This was obviously written before the TO_JSON addition.
Looks like it's Failed QA then ? Also, it would be nice to have more opinions on what the endpoints should be (/availability/object vs /object/availability) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #51 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Julian Maurice from comment #50)
(In reply to Tomás Cohen Arazi from comment #49)
I don't agree with the proposed endpoints layout. I belive we should have /items/{item_id}/availability instead.
The ->swaggerize methods aren't needed anymore as Koha::Object(s) implement the TO_JSON method with similar behaviour. This was obviously written before the TO_JSON addition.
Looks like it's Failed QA then ?
Yes.
Also, it would be nice to have more opinions on what the endpoints should be (/availability/object vs /object/availability)
I agree! It really depends on how it is going to be used. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #52 from Nick Clemens <nick@bywatersolutions.com> --- HI Lari, I just wanted to mention bug 21116 - tcohen worked on this as a way of prototyping new endpoints so the structures could be worked out a bit more before adding them to Koha - might be useful here or elsewhere -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23449 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23449 [Bug 23449] Get available pickup locations from REST API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lari.taskula@hypernova.fi |koha-bugs@lists.koha-commun | |ity.org --- Comment #53 from Lari Taskula <lari.taskula@hypernova.fi> --- I'm no longer able to work on this, so I'm setting assignee to default. Feel free to continue this work. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #54 from Julian Maurice <julian.maurice@biblibre.com> --- *** Bug 13927 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |arthur.suzuki@biblibre.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23336 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #55 from David Cook <dcook@prosentient.com.au> --- I'd love to revisit this. For now, I'm planning to look at https://github.com/NatLibFi/koha-plugin-rest-di since the folk in Finland have been kind enough to make their work available there! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #56 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I took a short cut to add an availability endpoint in bug 23336 but I'd love to see a more thorough treatment done longer term. The availability code needs a cleanup along the lines of what NatLibFi do I believe but I didn't have the sponsorship to go the distance that way. Happy to help though -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #57 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #56)
I took a short cut to add an availability endpoint in bug 23336 but I'd love to see a more thorough treatment done longer term. The availability code needs a cleanup along the lines of what NatLibFi do I believe but I didn't have the sponsorship to go the distance that way.
I've been wondering a bit if the word "availability" means different things to different people as well. For me, I'm interested in the "Status" message that we see on the OPAC. Is that the same thing needed for the checkout or is it a bit different? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #58 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #55)
I'd love to revisit this.
For now, I'm planning to look at https://github.com/NatLibFi/koha-plugin-rest-di since the folk in Finland have been kind enough to make their work available there!
I've just been talking to Ere on Zoom. I'm going to use the plugin API for now while I do a demo for a library, and if that goes well, then I'd be interested in working with Ere and anyone else (Tomas? Martin?) who want to help move this into core Koha. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #59 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #58)
(In reply to David Cook from comment #55)
I'd love to revisit this.
For now, I'm planning to look at https://github.com/NatLibFi/koha-plugin-rest-di since the folk in Finland have been kind enough to make their work available there!
I've just been talking to Ere on Zoom. I'm going to use the plugin API for now while I do a demo for a library, and if that goes well, then I'd be interested in working with Ere and anyone else (Tomas? Martin?) who want to help move this into core Koha.
How did it go? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #60 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #59)
How did it go?
I've had a few issues with the plugin, but Ere and I have worked on them. Overall, I don't have anyone actively using the integration I was working on that needed the plugin, so it hasn't advanced since May/June. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 --- Comment #61 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- We add a 'get_availability' API in bug 23336. It was initially inspired by the work in the aforementioned plugin, however the scope was narrowed.. It would be great to continue that work to clean up the availability calculations and migrate them into Koha:: namespace asap. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16826 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|arthur.suzuki@biblibre.com |koha-bugs@lists.koha-commun | |ity.org Status|Failed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org