Bug 39091

Summary: Cash registers should have a list API endpoint
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: REST APIAssignee: Pedro Amorim <pedro.amorim>
Status: Pushed to main --- QA Contact: Lisette Scheer <lisette>
Severity: enhancement    
Priority: P5 - low CC: lisette, martin.renvoize, pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
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:
Bug Depends on:    
Bug Blocks: 37893    
Attachments: Bug 39091: Add cash registers list REST API endpoint
Bug 39091: Add tests
Bug 39091: Add cash registers list REST API endpoint
Bug 39091: Add tests
Bug 39091: Add cash registers list REST API endpoint
Bug 39091: Add tests
Bug 39091: Add cash registers list REST API endpoint
Bug 39091: Add tests

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