Bug 39091 - Cash registers should have a list API endpoint
Summary: Cash registers should have a list API endpoint
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Pedro Amorim
QA Contact: Lisette Scheer
URL:
Keywords:
Depends on:
Blocks: 37893
  Show dependency treegraph
 
Reported: 2025-02-11 13:23 UTC by Pedro Amorim
Modified: 2025-07-23 22:40 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 39091: Add cash registers list REST API endpoint (4.58 KB, patch)
2025-02-11 13:25 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39091: Add tests (3.09 KB, patch)
2025-02-11 13:25 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39091: Add cash registers list REST API endpoint (4.64 KB, patch)
2025-04-02 08:08 UTC, Brendan Gallagher
Details | Diff | Splinter Review
Bug 39091: Add tests (3.15 KB, patch)
2025-04-02 08:08 UTC, Brendan Gallagher
Details | Diff | Splinter Review
Bug 39091: Add cash registers list REST API endpoint (4.63 KB, patch)
2025-04-15 09:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39091: Add tests (3.07 KB, patch)
2025-04-15 09:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39091: Add cash registers list REST API endpoint (4.69 KB, patch)
2025-07-22 15:52 UTC, Lisette Scheer
Details | Diff | Splinter Review
Bug 39091: Add tests (3.13 KB, patch)
2025-07-22 15:52 UTC, Lisette Scheer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2025-02-11 13:23:52 UTC

    
Comment 1 Pedro Amorim 2025-02-11 13:25:52 UTC
Created attachment 177731 [details] [review]
Bug 39091: Add cash registers list REST API endpoint
Comment 2 Pedro Amorim 2025-02-11 13:25:54 UTC
Created attachment 177732 [details] [review]
Bug 39091: Add tests

Test plan:
prove t/db_dependent/api/v1/cash_registers.t
Comment 3 Brendan Gallagher 2025-04-02 08:08:39 UTC
Created attachment 180253 [details] [review]
Bug 39091: Add cash registers list REST API endpoint

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 4 Brendan Gallagher 2025-04-02 08:08:42 UTC
Created attachment 180254 [details] [review]
Bug 39091: Add tests

Test plan:
prove t/db_dependent/api/v1/cash_registers.t

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 5 Martin Renvoize (ashimema) 2025-04-02 14:30:57 UTC
Minor QA review point... we're only exposing the 'list' endpoint here.. for that I think we're perhaps being overly cautious on the permissions.. rather than 'manage_cash_registers' which is the 'read,write,delete' permission for registers.. I'd perhaps only require 'catalogue' for the 'staff access' permission for viewing.
Comment 6 Katrin Fischer 2025-04-06 09:53:01 UTC
(In reply to Martin Renvoize (ashimema) from comment #5)
> Minor QA review point... we're only exposing the 'list' endpoint here.. for
> that I think we're perhaps being overly cautious on the permissions.. rather
> than 'manage_cash_registers' which is the 'read,write,delete' permission for
> registers.. I'd perhaps only require 'catalogue' for the 'staff access'
> permission for viewing.

Agree, that would make sense. Also seems not overly sensitive information?
Comment 7 Pedro Amorim 2025-04-15 09:12:55 UTC
Created attachment 180950 [details] [review]
Bug 39091: Add cash registers list REST API endpoint

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 8 Pedro Amorim 2025-04-15 09:12:58 UTC
Created attachment 180951 [details] [review]
Bug 39091: Add tests

Test plan:
prove t/db_dependent/api/v1/cash_registers.t

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 9 Pedro Amorim 2025-04-15 09:13:43 UTC
Hi guys, I've squashed the permission change to the main patch and squashed tidyness to tests patch.
Comment 10 Lisette Scheer 2025-07-22 15:52:35 UTC
Created attachment 184484 [details] [review]
Bug 39091: Add cash registers list REST API endpoint

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>

Worked as expected. Tested in postman and got the correct warning when no permissions were set. Only catalog is required. Swagger documentation looks great as well.
Comment 11 Lisette Scheer 2025-07-22 15:52:38 UTC
Created attachment 184485 [details] [review]
Bug 39091: Add tests

Test plan:
prove t/db_dependent/api/v1/cash_registers.t

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Comment 12 Lucas Gass (lukeg) 2025-07-23 22:40:37 UTC
Nice work everyone!

Pushed to main for 25.11