[Bug 36075] New: Add API route to list recalls
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Bug ID: 36075 Summary: Add API route to list recalls Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: aleisha@catalyst.net.nz CC: tomascohen@gmail.com -- 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=36075 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19532 Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |aleisha@catalyst.net.nz |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19532 [Bug 19532] Recalls for Koha -- 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=36075 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|19532 |35967 Status|NEW |Needs Signoff Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19532 [Bug 19532] Recalls for Koha https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35967 [Bug 35967] REST API: Add /api/v1/patrons/{patron_id}/recalls endpoint to list patron's recalls -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 --- Comment #1 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 162075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162075&action=edit Bug 36075: Add REST API endpoint to list recalls This enhancement adds a REST API endpoint to list recalls and run search queries on recalls /api/v1/recalls /api/v1/recalls?patron_id=X To test: 1. Log in to the staff interface as your superlibrarian self (Patron A) 2. Go to Koha Administration -> Global system preferences. Enable the UseRecalls system preference 3. Set the relevant recalls circulation and fines rules 4. Search for an item (Item A) 5. Check out Item A to yourself (Patron A) 6. Log in to the OPAC as Patron B 7. Search for Item A and request a recall 8. Test the API returns the recall: https://your-opac-url/api/v1/recalls 9. Test other search parameters: https://your-opac-url/api/v1/recalls?patron_id=PATRON_B_NUMBER 10. Confirm you are able to view a list of Patron B's recalls 11. Confirm tests pass: t/db_dependent/api/v1/recalls.t Sponsored-by: Auckland University of Technology -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162075|0 |1 is obsolete| | --- Comment #2 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 162087 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162087&action=edit Bug 36075: Add REST API endpoint to list recalls This enhancement adds a REST API endpoint to list recalls and run search queries on recalls /api/v1/recalls /api/v1/recalls?patron_id=X To test: 1. Log in to the staff interface as your superlibrarian self (Patron A) 2. Go to Koha Administration -> Global system preferences. Enable the UseRecalls system preference 3. Set the relevant recalls circulation and fines rules 4. Search for an item (Item A) 5. Check out Item A to yourself (Patron A) 6. Log in to the OPAC as Patron B 7. Search for Item A and request a recall 8. Test the API returns the recall: https://your-opac-url/api/v1/recalls 9. Test other search parameters: https://your-opac-url/api/v1/recalls?patron_id=PATRON_B_NUMBER 10. Confirm you are able to view a list of Patron B's recalls 11. Confirm tests pass: t/db_dependent/api/v1/recalls.t Sponsored-by: Auckland University of Technology -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- The tests failed for me 8-(: prove -v t/db_dependent/api/v1/recalls.t t/db_dependent/api/v1/recalls.t .. 1..1 # Subtest: list() tests 1..9 ok 1 - GET //u47rPv2aNmke8fdORvXFwavpqwMprAZRXAGEIbO3a8:thePassword123@/api/v1/recalls ok 2 - SWAGGER3.2.2 not ok 3 - exact match for JSON Pointer "" # Failed test 'exact match for JSON Pointer ""' # at t/db_dependent/api/v1/recalls.t line 51. # Structures begin differing at: # $got->[0] = HASH(0x5599d5bbb7f8) # $expected->[0] = Does not exist ok 4 - GET //u47rPv2aNmke8fdORvXFwavpqwMprAZRXAGEIbO3a8:thePassword123@/api/v1/recalls?patron_id=55 ok 5 - SWAGGER3.2.2 ok 6 - Recalls for patron retrieved ok 7 - GET //u47rPv2aNmke8fdORvXFwavpqwMprAZRXAGEIbO3a8:thePassword123@/api/v1/recalls?completed=false ok 8 - SWAGGER3.2.2 not ok 9 - Current recalls retrieved # Failed test 'Current recalls retrieved' # at t/db_dependent/api/v1/recalls.t line 60. # Structures begin differing at: # $got->[0]{waiting_date} = undef # $expected->[0]{waiting_date} = '2024-02-19T14:53:59+00:00' # Looks like you failed 2 tests of 9. not ok 1 - list() tests # Failed test 'list() tests' # at t/db_dependent/api/v1/recalls.t line 64. # Looks like you failed 1 test of 1. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- t/db_dependent/api/v1/recalls.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=1, 6 wallclock secs ( 0.01 usr 0.00 sys + 4.86 cusr 0.46 csys = 5.33 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162087|0 |1 is obsolete| | --- Comment #4 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 162290 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162290&action=edit Bug 36075: Add REST API endpoint to list recalls This enhancement adds a REST API endpoint to list recalls and run search queries on recalls /api/v1/recalls /api/v1/recalls?patron_id=X To test: 1. Log in to the staff interface as your superlibrarian self (Patron A) 2. Go to Koha Administration -> Global system preferences. Enable the UseRecalls system preference 3. Set the relevant recalls circulation and fines rules 4. Search for an item (Item A) 5. Check out Item A to yourself (Patron A) 6. Log in to the OPAC as Patron B 7. Search for Item A and request a recall 8. Test the API returns the recall: https://your-opac-url/api/v1/recalls 9. Test other search parameters: https://your-opac-url/api/v1/recalls?patron_id=PATRON_B_NUMBER 10. Confirm you are able to view a list of Patron B's recalls 11. Confirm tests pass: t/db_dependent/api/v1/recalls.t Sponsored-by: Auckland University of Technology Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 162291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162291&action=edit Bug 36075: QA Follow-up: Fix tests recall_1 needs to specifically be completed => 0 or else it'll sometimes be 1 and other times be 0 when running tests, causing tests to sometimes fails and other times succeed Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162291|0 |1 is obsolete| | --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 162292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162292&action=edit Bug 36075: (QA follow-up): Fix tests recall_1 needs to specifically be completed => 0 or else it'll sometimes be 1 and other times be 0 when running tests, causing tests to sometimes fails and other times succeed Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 --- Comment #7 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Pedro Amorim from comment #6)
Created attachment 162292 [details] [review] Bug 36075: (QA follow-up): Fix tests
recall_1 needs to specifically be completed => 0 or else it'll sometimes be 1 and other times be 0 when running tests, causing tests to sometimes fails and other times succeed
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
That makes sense! Thank you for the follow up :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Aleisha, do you really need those query parameters you are adding here? We are not adding them lately. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Please: * Remove (inline) the extra query parameters. I think keeping 'completed' makes sense, though. * Review the documentation in the spec, as it (at least) mentions "patron's recalls" in one place. * The json_is( '' => [...], 'Current recalls....' ) is not something we use. In such cases you don't need to add the test description as it is clear that you are testing the response structure matches something. Not a blocker. the rest of it is perfect :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36075 Bug 36075 depends on bug 35967, which changed state. Bug 35967 Summary: Add /api/v1/patrons/{patron_id}/recalls endpoint to list a patron's recalls https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35967 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org