Bug 19037 - Circulation and fine rules test tool
Summary: Circulation and fine rules test tool
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lari Taskula
QA Contact: Testopia
URL:
Keywords:
: 26034 (view as bug list)
Depends on: 18137
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-04 12:23 UTC by Lari Taskula
Modified: 2021-05-07 18:14 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
example screenshot (55.74 KB, image/png)
2017-08-04 12:24 UTC, Lari Taskula
Details
Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule (35.62 KB, patch)
2017-08-06 23:16 UTC, Lari Taskula
Details | Diff | Splinter Review
KD-2316: Issuing rules test tool - GUI for test tool (14.27 KB, patch)
2017-08-06 23:17 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 19037: Issuing rules test tool - GUI for test tool (14.21 KB, patch)
2017-08-06 23:18 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 19037: Issuing rules test tool - GUI for test tool (13.95 KB, patch)
2017-08-06 23:18 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2017-08-04 12:23:46 UTC
Add a test tool for circulation and fine rules. The point of the tool is to display the effective issuing rule that matches item, patron and branch.

Add a REST API endpoint to query effective issuing rules by given parameters.
Comment 1 Lari Taskula 2017-08-04 12:24:29 UTC
Created attachment 65497 [details]
example screenshot
Comment 2 Lari Taskula 2017-08-04 12:31:06 UTC
This has been implement but needs a rebase to be suitable for applying on master. It uses REST API and requires Bug 18137. Code of our current implementation for the API endpoint is here
https://github.com/KohaSuomi/Koha/commit/fc9f92651a39bf371cfde10fd46abdeb81e212ec

...and the GUI here 
https://github.com/KohaSuomi/Koha/commit/d089582e32d98fcd82e544b8a51aedcb7da3ba90

Attached a screenshot so you can see how it looks.
Comment 3 Lari Taskula 2017-08-06 23:16:53 UTC
Created attachment 65523 [details] [review]
Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule

To test:
1. prove t/db_dependent/api/v1/issuingrules.t
2. Send GET requests to /api/v1/issuingrules/effective with different parameters
   as defined in the path's Swagger spec
3. Make sure it returns the correct issuing rules (don't forget that system prefs
   like CircControl and HomeOrHoldingBranch affects the result)
Comment 4 Lari Taskula 2017-08-06 23:17:14 UTC Comment hidden (obsolete)
Comment 5 Lari Taskula 2017-08-06 23:18:03 UTC Comment hidden (obsolete)
Comment 6 Lari Taskula 2017-08-06 23:18:51 UTC
Created attachment 65526 [details] [review]
Bug 19037: Issuing rules test tool - GUI for test tool

To test:
1. Go to INTRANET/cgi-bin/koha/admin/smart-rules.pl
2. You should see a button below circulation rules matrix
   "Circulation and fine rules test tool"
3. Click it
4. You should see options for inputting test patron, item and branch
5. Play with the tester and make sure it returns correct issuing rules
   (CircControl and HomeOrHoldingBranch system preferences affects the result)
Comment 7 Lari Taskula 2017-08-06 23:27:04 UTC
Testing this tool requires Bug 18137. It has some Perl dependencies, please see the patch called "List Mojolicious::Plugin::OpenAPI and JSON::Validator as dependencies" for versions of dependencies that are confirmed to work. Make sure to install those versions or otherwise the endpoint (and the tool) may not work.
Comment 8 Alex Buckley 2017-10-23 10:04:20 UTC
Hi Lari

When applying these patches I found that they threw an error even though I had the dependencies in my branch:

Applying: Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule
fatal: sha1 information is lacking or useless (t/db_dependent/api/v1/cities.t).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule
The copy of the patch that failed is found in:
   /home/vagrant/kohaclone/.git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-19037-Issuing-rules-test-tool---REST-API-endpo-M5ZrDP.patch
Comment 9 Christopher Brannon 2020-07-22 14:32:23 UTC
*** Bug 26034 has been marked as a duplicate of this bug. ***