[Bug 13903] New: Add API routes to list, create, update, delete reserves
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Bug ID: 13903 Summary: Add API routes to list, create, update, delete reserves Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Web services Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org Depends on: 13799 Add API routes to list, create, update, delete reserves -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 37210 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37210&action=edit Bug 13903: Add API routes to list, create, update, delete reserves GET /borrowers/reserves (list) POST /borrowers/reserves (create) PUT /reserves/{reserve_id} (update) DELETE /reserves/{reserve_id} (delete) Unit tests in t/db_dependent/api/v1/borrowers/reserves.t and t/db_dependent/api/v1/reserves.t Test plan: 1/ Go to http://api.yourlibrary/v1/doc and test the above routes with different values for each parameter 2/ Try to make reserves until the maximum number of reserves for a user is reached (you should have a 403 error then) 3/ Run unit tests Depends on bug 13799 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi there, just wondering: should we use holds instead of reserves? Reserves is in the code, but all the gui uses the term holds. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Hi Katrin, I started this by using "holds", but since the ID field is named "reserve_id" and it's returned in some responses, I think it's more consistent to use "reserves". -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13927 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #2)
Hi there, just wondering: should we use holds instead of reserves? Reserves is in the code, but all the gui uses the term holds.
+1 for "holds". And I don't fear refactoring the code a bit to make it more consistent. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |olli-antti.kivilahti@jns.fi --- Comment #5 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- I did some testing and found the following issues: POST-request -There should be an exception for non-existent branchcode? So we pass a branchcode as a param which doesn't match any branch we have. -expirationdate-parameter is mandatory. Eg. it must be given as a parameter with a value of null or something sensible. -itemnumber is mandatory? How about biblio-level holds? -C4::Reserves::AddReserves() modification out of scope. -Repeatedly placing a reserve places multiple holds for the same itemnumber. Etag/Timestamp needed to prevent accepting the same request many times. Also I think this is against Koha business rules. PUT-request -Optional fields mandatory. Can be circumvented by using parameters "" and "0000-00-00" DELETE-request -Deletes OK, but returns a "page not found"-error. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ere.maijala@helsinki.fi -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40589 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40589&action=edit Bug 13903: 6. Add API routes to list, create, update, delete reserves -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37210|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 --- Comment #7 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Tested that the parameter definition "optional" actually works, and they just aren't used. "properties": { "biblionumber": { "description": "Biblio internal identifier", - "type": "integer" + "type": "integer", + "required": true }, "itemnumber": { "description": "Item internal identifier", - "type": "integer" + "type": "integer", + "required": true }, "branchcode": { "description": "Pickup location", @@ -413,7 +415,8 @@ "expirationdate": { "description": "Reserve end date", "type": "string", - "format": "date" + "format": "date", + "required": false Using these Swagger2Validator no longer complains about missing parameters and stuff just works ! This resolves the OPTIONAL/MANDATORY-issue. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40589|0 |1 is obsolete| | --- Comment #8 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41164 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41164&action=edit Bug 13903: 6. Add API routes to list, create, update, delete reserves -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41164|0 |1 is obsolete| | --- Comment #9 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41549 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41549&action=edit Bug 13903: 6. Add API routes to list, create, update, delete reserves -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14526 CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Be care, AddReserve prototype changed by bug 14526 (contrainst param removed). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|http://bugs.koha-community. |http://bugs.koha-community. |org/bugzilla3/show_bug.cgi? |org/bugzilla3/show_bug.cgi? |id=14526 |id=9809 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I meant bug 9809. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41549|0 |1 is obsolete| | --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 45842 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45842&action=edit Bug 13903: Add API routes to list, create, update, delete reserves GET /reserves?borrowernumber=X (list) POST /reserves (create) PUT /reserves/{reserve_id} (update) DELETE /reserves/{reserve_id} (delete) Unit tests in t/db_dependent/api/v1/reserves.t Test plan: 1. Apply patch 2. Run unit tests 3. Play with the API with your favorite REST client, using documentation in the swagger.json file 4. Try to make reserves until the maximum number of reserves for a user is reached (you should have a 403 error) Depends on bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Rebased on top of bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15566 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15566 [Bug 15566] Update API to allow to reserve first available item from a group of titles -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13903 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15567 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15567 [Bug 15567] Update API to allow multiple holds for the same record -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org