[Bug 34333] New: Add cancellation requests count to the holds endpoint
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Bug ID: 34333 Summary: Add cancellation requests count to the holds endpoint 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: tomascohen@gmail.com CC: tomascohen@gmail.com When rendering holds tables either in Koha, or in external systems consuming the API, it would be handy to have this information, to give special handling and links to those 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=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add cancellation requests |Add cancellation requests |count to the holds endpoint |count embed option to the | |holds endpoint -- 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=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add cancellation requests |Add cancellation request |count embed option to the |information embed option to |holds endpoint |the holds endpoint -- 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=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |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=34333 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 153744 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153744&action=edit Bug 34333: Add Koha::Hold->cancellation_requested This patch adds a helper method for telling if a hold has cancellation requests. To be used for embedding such information. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: Tests pass, the new method is covered by tests. 3. Sign off :-D -- 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=34333 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 153745 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153745&action=edit Bug 34333: Add embed option for `cancellation_requested` for holds This patch adds the `cancellation_requested` attribute to the hold object definition, and allows embeding it as on the different holds endpoints that migt be useful. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Hold.t \ t/db_dependent/api/v1/*holds.t => SUCCESS: Tests pass! 3. Play with your REST tool (Postman?) on the following endpoints: GET http://localhost:8081/api/v1/holds GET http://localhost:8081/api/v1/patrons/:patron_id/holds on both, pass and not pass the `x-koha-embed` header with `cancellation_requested` on it. => SUCCESS: It is easy! You see the attribute and you don't, and the content makes sense! 4. Sign off :-D -- 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=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.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=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34365 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153744|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 155735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155735&action=edit Bug 34333: Add Koha::Hold->cancellation_requested This patch adds a helper method for telling if a hold has cancellation requests. To be used for embedding such information. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: Tests pass, the new method is covered by tests. 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153745|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 155736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155736&action=edit Bug 34333: Add embed option for `cancellation_requested` for holds This patch adds the `cancellation_requested` attribute to the hold object definition, and allows embeding it as on the different holds endpoints that migt be useful. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Hold.t \ t/db_dependent/api/v1/*holds.t => SUCCESS: Tests pass! 3. Play with your REST tool (Postman?) on the following endpoints: GET http://localhost:8081/api/v1/holds GET http://localhost:8081/api/v1/patrons/:patron_id/holds on both, pass and not pass the `x-koha-embed` header with `cancellation_requested` on it. => SUCCESS: It is easy! You see the attribute and you don't, and the content makes sense! 4. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Testing notes (using KTD and Postman): 1. Enable RESTBasicAuth 2. Place some holds. 3. When `x-koha-embed` header with `cancellation_requested` added, there is an extra line in results for each hold: "cancellation_requested": false, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155735|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 155794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155794&action=edit Bug 34333: Add Koha::Hold->cancellation_requested This patch adds a helper method for telling if a hold has cancellation requests. To be used for embedding such information. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: Tests pass, the new method is covered by tests. 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@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=34333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155736|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 155795 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155795&action=edit Bug 34333: Add embed option for `cancellation_requested` for holds This patch adds the `cancellation_requested` attribute to the hold object definition, and allows embeding it as on the different holds endpoints that migt be useful. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Hold.t \ t/db_dependent/api/v1/*holds.t => SUCCESS: Tests pass! 3. Play with your REST tool (Postman?) on the following endpoints: GET http://localhost:8081/api/v1/holds GET http://localhost:8081/api/v1/patrons/:patron_id/holds on both, pass and not pass the `x-koha-embed` header with `cancellation_requested` on it. => SUCCESS: It is easy! You see the attribute and you don't, and the content makes sense! 4. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@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=34333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Clear improvement, no QA issues.. Passing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.04 released in| | Status|Pushed to master |Pushed to stable --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Small enhancement on API, I choose to backport Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.04 |23.11.00,23.05.04,22.11.11 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 --- Comment #11 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Tomas, yesterday's weirdness is coming from: + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - cancellation_requested + collectionFormat: csv collectionFormat is an attribute of the header, no the items, it should have been: + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - cancellation_requested + collectionFormat: csv -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35658 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35658 [Bug 35658] Embedding broken in /patrons/:patron_id/holds -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@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=34333 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldstable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org