[Bug 36641] New: Add an endpoint to list circulation rules for an itemtype, branchcode and patron category combination
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Bug ID: 36641 Summary: Add an endpoint to list circulation rules for an itemtype, branchcode and patron category combination 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: martin.renvoize@ptfs-europe.com CC: tomascohen@gmail.com It would be helpful to have an API endpoint that allowed fetching the circulation rules for a given itemtype, branchcode and patron category combination. -- 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=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.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=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34440 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34440 [Bug 34440] Add warm-up and cool-down periods to bookings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 165086 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165086&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch is a proof of concept for an API endpoint that returns a list of circulation rules for the specified itemtype, branchcode and patron category combination. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Setting to NSO to get eyes.. but right at this moment it would fail QA for lack of tests. I want feedback specifically on the URL and the form of the response and if we're happy for it to be an open object or want to a spec for it with each of the available circ rule keys listed but optional. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add an endpoint to list |Add an endpoint to list |circulation rules for an |effective circulation rules |itemtype, branchcode and |for an itemtype, |patron category combination |branchcode, patron category | |combination -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Michelle Spinney <mspinney@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mspinney@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- A few remarks: * The order of the path parameters is arbitrary, right? I assume you thought about it * The parameter names should be fixed to our current uses * The returned structure is under specified * I never liked /circulation-rules, can we make it /circulation_rules so it matches all other routes? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19037 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm looking to come back to this now. OK, so you'd like me to update the existing endpoint to `/circulation_rules/kinds` and add mine as `/circulation_rules`. I can do that.. though do we know if anyone out there is using the /kinds route already? I did think about the order of parameters, though I not wed to it. I had them as path params as I felt it made it clearer that the endpoint expects all of them to be filled.. however we could just have them as query params and then order is inherently meaningless and in fact we don't actually always needs all of them really. Yes, I said the return structure is underspecified.. but it's also a bit variable.. I'll try to see what I can come up with. Are you saying you want the 'kinds' param to be an enum of all rule kinds.. I was sort of trying to avoid having to list those again.. I wish it was simple to build this particular list from code to embed into the spec.. maybe I can.. I'll investigate. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Martin Renvoize from comment #4)
OK, so you'd like me to update the existing endpoint to `/circulation_rules/kinds` and add mine as `/circulation_rules`. I can do that.. though do we know if anyone out there is using the /kinds route already?
Consider in testing now, it's already broken I think we're safe to change it now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165086|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 167937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167937&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch is a proof of concept for an API endpoint that returns a list of circulation rules for the specified itemtype, branchcode and patron category combination. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 167938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167938&action=edit Bug 36641: (follow-up) Requested changes This patch does a few things: 1) Moves /circulation-rules to /circulation_rules 2) Adds a the missing permission to /circulation_rules/kinds 3) Updates the circ-rule-kind definition to allow for the new fields added since the route was first defined 4) Adds a 'render_invalid_parameter_value' helper to ::Responses 5) Uses the above helper to render a 400 when an invalid branchcode, itemtype or patron category code is used for filtering 6) Converts from required path based parameters to optional query based parameters. 7) Refined the definition for the 'rules' response so we now only allow for 'string' or 'integer' values for the keys in the response. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm still not especially happy with the /kinds endpoint but at least with this patch it responds something.. I think we should handle cleaning it up properly in another bug. I am fairly happy with the end result of the follow-up however. Please let me know what you think Tomas. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167937|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 167946 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167946&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch is a proof of concept for an API endpoint that returns a list of circulation rules for the specified itemtype, branchcode and patron category combination. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167938|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 167947 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167947&action=edit Bug 36641: (follow-up) Requested changes This patch does a few things: 1) Moves /circulation-rules to /circulation_rules 2) Adds a the missing permission to /circulation_rules/kinds 3) Updates the circ-rule-kind definition to allow for the new fields added since the route was first defined 4) Adds a 'render_invalid_parameter_value' helper to ::Responses 5) Uses the above helper to render a 400 when an invalid branchcode, itemtype or patron category code is used for filtering 6) Converts from required path based parameters to optional query based parameters. 7) Refined the definition for the 'rules' response so we now only allow for 'string' or 'integer' values for the keys in the response. NOTE: The multi for the 'rules' query parameter fails to work at the moment. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168018 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168018&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167946|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168019 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168019&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167947|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=36641 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168020 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168020&action=edit Bug 36641: WIP - Add unit tests for /circulation_rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168018|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168023&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168024 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168024&action=edit Bug 36641: Add unit tests for /circulation_rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168019|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168025 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168025&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168020|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=36641 Tomás Cohen Arazi <tomascohen@gmail.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=36641 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168023|0 |1 is obsolete| | Attachment #168024|0 |1 is obsolete| | Attachment #168025|0 |1 is obsolete| | --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 168365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168365&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 168366 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168366&action=edit Bug 36641: Add unit tests for /circulation_rules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 168367 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168367&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 168368 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168368&action=edit Bug 36641: Harmonize parameter names Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 168369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168369&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168369|0 |1 is obsolete| | --- Comment #22 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 168370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168370&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #23 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Hi, this all looks great. I would go with a straight QA, but I want your opinion, Martin on wrapping it in a try/catch block, having the usual `$c->unhandled_exception($_);`. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 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=36641 --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Tomás Cohen Arazi from comment #23)
Hi, this all looks great. I would go with a straight QA, but I want your opinion, Martin on wrapping it in a try/catch block, having the usual `$c->unhandled_exception($_);`.
That's not a bad idea.. I did wonder it briefly myself.. I forget now why I didn't add it.... hmm Thanks for all the work here btw, really appreciate it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168378&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168378|0 |1 is obsolete| | --- Comment #26 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168379&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|tomascohen@gmail.com |kyle@bywatersolutions.com CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168365|0 |1 is obsolete| | Attachment #168366|0 |1 is obsolete| | Attachment #168367|0 |1 is obsolete| | Attachment #168368|0 |1 is obsolete| | Attachment #168370|0 |1 is obsolete| | Attachment #168379|0 |1 is obsolete| | --- Comment #27 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168395&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #28 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168396&action=edit Bug 36641: Add unit tests for /circulation_rules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #29 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168397&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #30 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168398 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168398&action=edit Bug 36641: Harmonize parameter names Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #31 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168399 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168399&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #32 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168400 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168400&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #33 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 168401 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168401&action=edit Bug 36641: (QA Follow-up) Fix variable name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |19037 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19037 [Bug 19037] Circulation and fine rules test tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |10190 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10190 [Bug 10190] Overdue notice triggers based on item type -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #34 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm re-considering this slightly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #35 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168841&action=edit Bug 36641: (follow-up) Update to allow returning non-effective rules This patch updates the existing /circulation_rules endpoint introduced in this patchset to allow return of all rule sets rather than only the effective set. We continue to default to the effective set for the parameters passed which will mean by default you will get an arrayref containing one hashref entry with each rule kind as a key in that hashref. However, if you add 'effective=false' as a query parameter, you will now have an arrayref of all rule sets that match your passed criteria including rules that may have fallen back to defaults in the effective case. WIP: Need to add support for * in branch, itemtype, patron category query parameters to allow explicit return of default rules vs no filter passed. (i.e. for the effective=false case where all rules for should be returned when no filters are passed vs * passed to filter to just default rules vs specifics passed for branch/item/patron filtering. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168395|0 |1 is obsolete| | --- Comment #36 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168874 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168874&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168396|0 |1 is obsolete| | --- Comment #37 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168875 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168875&action=edit Bug 36641: Add unit tests for /circulation_rules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168397|0 |1 is obsolete| | --- Comment #38 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168876 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168876&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168398|0 |1 is obsolete| | --- Comment #39 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168877 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168877&action=edit Bug 36641: Harmonize parameter names Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168399|0 |1 is obsolete| | --- Comment #40 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168878 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168878&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168400|0 |1 is obsolete| | --- Comment #41 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168879 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168879&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168401|0 |1 is obsolete| | --- Comment #42 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168880 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168880&action=edit Bug 36641: (QA Follow-up) Fix variable name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168841|0 |1 is obsolete| | --- Comment #43 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168881 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168881&action=edit Bug 36641: (follow-up) Update to allow returning non-effective rules This patch updates the existing /circulation_rules endpoint introduced in this patchset to allow return of all rule sets rather than only the effective set. We continue to default to the effective set for the parameters passed which will mean by default you will get an arrayref containing one hashref entry with each rule kind as a key in that hashref. However, if you add 'effective=false' as a query parameter, you will now have an arrayref of all rule sets that match your passed criteria including rules that may have fallen back to defaults in the effective case. WIP: Need to add support for * in branch, itemtype, patron category query parameters to allow explicit return of default rules vs no filter passed. (i.e. for the effective=false case where all rules for should be returned when no filters are passed vs * passed to filter to just default rules vs specifics passed for branch/item/patron filtering. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #44 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168882 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168882&action=edit Bug 36641: Optionally filter to default rules using * -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #45 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168883 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168883&action=edit Bug 36641: Return '*' for 'default rule' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #46 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168884 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168884&action=edit Bug 36641: Unit tests for effective=0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add an endpoint to list |Add an endpoint to list |effective circulation rules |circulation rules |for an itemtype, | |branchcode, patron category | |combination | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #47 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- The scope here grew a bit as I tried to think about the future and how we might implement the Create, Update and Delete parts of the API. We continue to default to returning 'Effective' rule sets, however, I've now introduced an 'effective' query parameter which can be set to '0' to get back all branchcode, category, itemtype combination rule sets. The response differs slightly between effective and all responses.. both are now an arrayref of hashrefs but the effective rules only returns defined rules in the hash whereas the all response hashes will always contain all keys, defined or otherwise. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168874|0 |1 is obsolete| | --- Comment #48 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168905 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168905&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168875|0 |1 is obsolete| | --- Comment #49 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168906 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168906&action=edit Bug 36641: Add unit tests for /circulation_rules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168876|0 |1 is obsolete| | --- Comment #50 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168907 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168907&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168877|0 |1 is obsolete| | --- Comment #51 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168908 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168908&action=edit Bug 36641: Harmonize parameter names Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168878|0 |1 is obsolete| | --- Comment #52 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168909 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168909&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168879|0 |1 is obsolete| | --- Comment #53 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168910 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168910&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168880|0 |1 is obsolete| | --- Comment #54 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168911 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168911&action=edit Bug 36641: (QA Follow-up) Fix variable name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168881|0 |1 is obsolete| | --- Comment #55 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168912 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168912&action=edit Bug 36641: (follow-up) Update to allow returning non-effective rules This patch updates the existing /circulation_rules endpoint introduced in this patchset to allow return of all rule sets rather than only the effective set. We continue to default to the effective set for the parameters passed which will mean by default you will get an arrayref containing one hashref entry with each rule kind as a key in that hashref. However, if you add 'effective=false' as a query parameter, you will now have an arrayref of all rule sets that match your passed criteria including rules that may have fallen back to defaults in the effective case. WIP: Need to add support for * in branch, itemtype, patron category query parameters to allow explicit return of default rules vs no filter passed. (i.e. for the effective=false case where all rules for should be returned when no filters are passed vs * passed to filter to just default rules vs specifics passed for branch/item/patron filtering. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168882|0 |1 is obsolete| | --- Comment #56 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168913&action=edit Bug 36641: Optionally filter to default rules using * -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168883|0 |1 is obsolete| | --- Comment #57 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168914&action=edit Bug 36641: Return '*' for 'default rule' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #58 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168915 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168915&action=edit Bug 36641: Ensure we return all keys When using the effective route, we were missing some rule kinds if a rule hadn't yet been defined for them. We should instead return the rule as undefined. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168884|0 |1 is obsolete| | --- Comment #59 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168916 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168916&action=edit Bug 36641: Unit tests for effective=0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168905|0 |1 is obsolete| | --- Comment #60 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168926 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168926&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168906|0 |1 is obsolete| | --- Comment #61 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168927&action=edit Bug 36641: Add unit tests for /circulation_rules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168907|0 |1 is obsolete| | --- Comment #62 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168928 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168928&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168908|0 |1 is obsolete| | --- Comment #63 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168929 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168929&action=edit Bug 36641: Harmonize parameter names Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168909|0 |1 is obsolete| | --- Comment #64 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168930 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168930&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168910|0 |1 is obsolete| | --- Comment #65 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168931 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168931&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168911|0 |1 is obsolete| | --- Comment #66 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168932 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168932&action=edit Bug 36641: (QA Follow-up) Fix variable name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168912|0 |1 is obsolete| | --- Comment #67 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168933&action=edit Bug 36641: (follow-up) Update to allow returning non-effective rules This patch updates the existing /circulation_rules endpoint introduced in this patchset to allow return of all rule sets rather than only the effective set. We continue to default to the effective set for the parameters passed which will mean by default you will get an arrayref containing one hashref entry with each rule kind as a key in that hashref. However, if you add 'effective=false' as a query parameter, you will now have an arrayref of all rule sets that match your passed criteria including rules that may have fallen back to defaults in the effective case. WIP: Need to add support for * in branch, itemtype, patron category query parameters to allow explicit return of default rules vs no filter passed. (i.e. for the effective=false case where all rules for should be returned when no filters are passed vs * passed to filter to just default rules vs specifics passed for branch/item/patron filtering. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168913|0 |1 is obsolete| | --- Comment #68 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168934&action=edit Bug 36641: Optionally filter to default rules using * -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168914|0 |1 is obsolete| | --- Comment #69 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168935&action=edit Bug 36641: Return '*' for 'default rule' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168915|0 |1 is obsolete| | --- Comment #70 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168936&action=edit Bug 36641: Ensure we return all keys When using the effective route, we were missing some rule kinds if a rule hadn't yet been defined for them. We should instead return the rule as undefined. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168916|0 |1 is obsolete| | --- Comment #71 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168937&action=edit Bug 36641: Unit tests for effective=0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #72 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168938&action=edit Bug 36641: (follow-up) Ensure limited return works We have a ?rules=a,b parameter available for specifying a subset of rules in the set to return. This patch adds a test to confirm that works (and fixes the controller and specification as the test proved it wasn't working) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168938|0 |1 is obsolete| | --- Comment #73 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168940&action=edit Bug 36641: (follow-up) Ensure limited return works We have a ?rules=a,b parameter available for specifying a subset of rules in the set to return. This patch adds a test to confirm that works (and fixes the controller and specification as the test proved it wasn't working) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37256 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37256 [Bug 37256] Add an endpoint to allow setting a circulation rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168926|0 |1 is obsolete| | Attachment #168927|0 |1 is obsolete| | Attachment #168928|0 |1 is obsolete| | Attachment #168929|0 |1 is obsolete| | Attachment #168930|0 |1 is obsolete| | Attachment #168931|0 |1 is obsolete| | Attachment #168932|0 |1 is obsolete| | Attachment #168933|0 |1 is obsolete| | Attachment #168934|0 |1 is obsolete| | Attachment #168935|0 |1 is obsolete| | Attachment #168936|0 |1 is obsolete| | Attachment #168937|0 |1 is obsolete| | Attachment #168940|0 |1 is obsolete| | --- Comment #74 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169013 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169013&action=edit Bug 36641: Introduce render_invalid_parameter_value helper This patch introduces a new 'render_invalid_parameter_value' helper method that accepts 'path' and 'values' parameters to denote which field has failed validation and where the end user can get valid options. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #75 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169014 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169014&action=edit Bug 36641: Add unit tests for /circulation_rules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #76 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169015 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169015&action=edit Bug 36641: Add endpoint for fetching circulation rules This patch adds an endpoint for fetching ciruclations rules given the constraints of the passed parameters. We optionally expect item_type, library and patron_category as query parameters and we return a list of relevant circulation rules pertaining to that combination of requirements. You can also add a list of `rules` as a query parameter to limit the response to only the rules you are interested in for this combination. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #77 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169016 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169016&action=edit Bug 36641: Harmonize parameter names Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #78 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169017&action=edit Bug 36641: Make tests cover all code paths Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #79 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169018 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169018&action=edit Bug 36641: (follow-up) Wrap in a try/catch block This patch adds the missing try/catch and unhandled exception error handler to the new list_effective_rules endpoint. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #80 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169019 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169019&action=edit Bug 36641: (QA follow-up) Fix variable name Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #81 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169020 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169020&action=edit Bug 36641: (follow-up) Update to allow returning non-effective rules This patch updates the existing /circulation_rules endpoint introduced in this patchset to allow return of all rule sets rather than only the effective set. We continue to default to the effective set for the parameters passed which will mean by default you will get an arrayref containing one hashref entry with each rule kind as a key in that hashref. However, if you add 'effective=false' as a query parameter, you will now have an arrayref of all rule sets that match your passed criteria including rules that may have fallen back to defaults in the effective case. WIP: Need to add support for * in branch, itemtype, patron category query parameters to allow explicit return of default rules vs no filter passed. (i.e. for the effective=false case where all rules for should be returned when no filters are passed vs * passed to filter to just default rules vs specifics passed for branch/item/patron filtering. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #82 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169021 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169021&action=edit Bug 36641: Optionally filter to default rules using * Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #83 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169022&action=edit Bug 36641: Return '*' for 'default rule' Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #84 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169023&action=edit Bug 36641: Ensure we return all keys When using the effective route, we were missing some rule kinds if a rule hadn't yet been defined for them. We should instead return the rule as undefined. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #85 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169024 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169024&action=edit Bug 36641: Unit tests for effective=0 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #86 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169025 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169025&action=edit Bug 36641: (follow-up) Ensure limited return works We have a ?rules=a,b parameter available for specifying a subset of rules in the set to return. This patch adds a test to confirm that works (and fixes the controller and specification as the test proved it wasn't working) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #87 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 169026 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169026&action=edit Bug 36641: Fix tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #88 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- 🎉 Thanks Tomas! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 --- Comment #89 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37590 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37590 [Bug 37590] Allow requesting circulation rule sets using wildcards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds a new release notes| |`/circulation_rules` | |endpoint to the API's to | |allow fetching of | |circulation rules. | | | |It | |requires item_type, | |patron_category and library | |as parameters and accepts | |an options 'rules' | |parameter to allow listing | |only rules that are of | |interest. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36641 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #90 from David Nind <david@davidnind.com> --- No updates required to the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org