[Bug 36481] New: Add GET /libraries/:library_id/cash_registers
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Bug ID: 36481 Summary: Add GET /libraries/:library_id/cash_registers 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 I propose to add an endpoint for fetching a library's list of cash registers. Context is bug 36237. -- 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=36481 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36237 -- 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=36481 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Depends on| |36237 See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36237 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36237 [Bug 36237] Improve set-library UI after 34478 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 164228 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164228&action=edit Bug 36481: Add GET /libraries/:library_id/cash_registers This patch adds the mentioned route. For the task it: * Adds Koha::Cash::Register->to_api_mapping with trivial mappings * Adds a cash_register object definition on the API spec * Adds a controller to handle requests * Adds tests for the new endpoint To test: 1. Apply this patch 2. Run: $ ktd --shell k$ qa => SUCCESS: All green! Tests pass! 3. Play with Postman! 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36482 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36482 [Bug 36482] Make it possible to embed desks and cash_registers on /libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 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=36481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164228|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 164237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164237&action=edit Bug 36481: Add GET /libraries/:library_id/cash_registers This patch adds the mentioned route. For the task it: * Adds Koha::Cash::Register->to_api_mapping with trivial mappings * Adds a cash_register object definition on the API spec * Adds a controller to handle requests * Adds tests for the new endpoint To test: 1. Apply this patch 2. Run: $ ktd --shell k$ qa => SUCCESS: All green! Tests pass! 3. Play with Postman! 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=36481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds an release notes| |API endpoint for requesting | |a list of cash registers | |for a library. For example: | |http://127.0.0.1:8080/api/v | |1/libraries/cpl/cash_regist | |ers CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Not able to the patch on current master without applying 36480 first. Assuming bug 36480 needs to be added as a dependency. Testing notes (using KTD) ========================= 1. Apply bug 36480 2. Apply the patches for this bug (and dependencies). 3. qa and tests should pass without any errors 4. Enable these system preferences: - UseCashRegisters - RESTBasicAuth 5. Test the new API endpoint using Postman (or browser): - In the staff interface, add some cash registers for different libraries, some with multiple registers - Add a get request to request the cash registers for a library, for example: add two cash registers to Centerville and one to Fairfield: . Set Basic Auth in Postman to use koha/koha . http://127.0.0.1:8080/api/v1/libraries/cpl/cash_registers . http://127.0.0.1:8080/api/v1/libraries/ffl/cash_registers - Results should return the cash register information for the library, for example: [ { "archived": false, "branch_default": false, "cash_register_id": 3, "description": "Test cash register for Centerville", "library_id": "CPL", "name": "TEST1", "starting_float": 0.0 }, { "archived": false, "branch_default": false, "cash_register_id": 4, "description": "Another test cash register for Centerville", "library_id": "CPL", "name": "TEST2", "starting_float": 0.0 } ] - Put an invalid library code in the request, for example xxx: . http://127.0.0.1:8080/api/v1/libraries/xxx/cash_registers . Should get "Library not found" error - Disable cash registers and send above request. Should get: { "error": "Feature disabled" } Note: If cash registers are enabled, but a library has none set up, then the response is blank. Should there be an error/response saying this library has no cash registers setup? . Response received where library doesn't have a cash register: [] Path doesn't apply messages =========================== git bz apply 36481 Bug 36481 Depends on bug 36237 (Signed Off) Follow? [(y)es, (n)o] y Bug 36237 - Improve set-library UI after 34478 163013 - Bug 36237: UI improvments for set-library page Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 36237: UI improvments for set-library page Bug 36481 - Add GET /libraries/:library_id/cash_registers 164228 - Bug 36481: Add GET /libraries/:library_id/cash_registers Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 36481: Add GET /libraries/:library_id/cash_registers Using index info to reconstruct a base tree... M Koha/REST/V1/Libraries.pm M api/v1/swagger/paths/libraries.yaml M api/v1/swagger/swagger.yaml M t/db_dependent/api/v1/libraries.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/api/v1/libraries.t CONFLICT (content): Merge conflict in t/db_dependent/api/v1/libraries.t Auto-merging api/v1/swagger/swagger.yaml CONFLICT (content): Merge conflict in api/v1/swagger/swagger.yaml Auto-merging api/v1/swagger/paths/libraries.yaml CONFLICT (content): Merge conflict in api/v1/swagger/paths/libraries.yaml Auto-merging Koha/REST/V1/Libraries.pm CONFLICT (content): Merge conflict in Koha/REST/V1/Libraries.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 36481: Add GET /libraries/:library_id/cash_registers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|36237 |36480 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36237 [Bug 36237] Improve set-library UI after 34478 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36480 [Bug 36480] Add GET /libraries/:library_id/desks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to David Nind from comment #3)
Not able to the patch on current master without applying 36480 first. Assuming bug 36480 needs to be added as a dependency.
That's correct. I forgot to add it. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Pedro Amorim <pedro.amorim@ptfs-europe.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=36481 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164237|0 |1 is obsolete| | --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164415 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164415&action=edit Bug 36481: Add GET /libraries/:library_id/cash_registers This patch adds the mentioned route. For the task it: * Adds Koha::Cash::Register->to_api_mapping with trivial mappings * Adds a cash_register object definition on the API spec * Adds a controller to handle requests * Adds tests for the new endpoint To test: 1. Apply this patch 2. Run: $ ktd --shell k$ qa => SUCCESS: All green! Tests pass! 3. Play with Postman! 4. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@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=36481 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Being a little nit-picky, but shouldn't this be "library default"? + branch_default: + type: boolean + description: If this till is the branch default Adding "additional_work_needed", meaning "Asking for feedback". Not a blocker. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.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=36481 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! 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=36481 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 165965 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165965&action=edit Bug 36481: (QA follow-up) Rename branch_default to library_default Use agreed terminology 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=36481 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Follow-up created and pushed.. removing additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|24.05.00 |24.05.00,23.11.06 released in| | --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Oupsy : + responses: + 200: + description: A list of desks for the library Copy/paste error :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Bug 36481 depends on bug 36480, which changed state. Bug 36480 Summary: Add GET /libraries/:library_id/desks https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36480 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #12 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will not be backported to 23.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36481 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 169285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169285&action=edit Bug 36481: (follow-up) Add missing library_id parameter The /libraries/{library_id}/cash_registers endpoint was missing the library_id parameter definition from the swagger specification. 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=36481 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Follow-up pushed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org