Bug 37256

Summary: Add an endpoint to allow setting circulation rule sets
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: REST APIAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Pushed to main --- QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: kyle, lucas, matt.blenkinsop, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 36641    
Bug Blocks: 10190    
Attachments: Bug 37256: Defined 'context' of circulation rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Defined 'context' of circulation rules
Bug 37256: Unit tests for set_rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Defined 'context' of circulation rules
Bug 37256: Unit tests for set_rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Defined 'context' of circulation rules
Bug 37256: Unit tests for set_rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Ensure empty and null work as expected in PUT
Bug 37256: Defined 'context' of circulation rules
Bug 37256: Unit tests for set_rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Ensure empty and null work as expected in PUT
Bug 37256: Defined 'context' of circulation rules
Bug 37256: Unit tests for set_rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Ensure empty and null work as expected in PUT
Bug 37256: Defined 'context' of circulation rules
Bug 37256: Unit tests for set_rules
Bug 37256: Add 'PUT' for circulation rule sets
Bug 37256: Ensure empty and null work as expected in PUT

Description Martin Renvoize (ashimema) 2024-07-04 11:41:14 UTC
With bug 36641 we allow fetching a keys list of effective circulation rules given a combination of library, patron category and item type.

It would be great to have some endpoints to allow setting circulation rules via the API too.
Comment 1 Martin Renvoize (ashimema) 2024-08-02 13:48:02 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize (ashimema) 2024-08-02 13:48:04 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize (ashimema) 2024-08-02 13:48:53 UTC
Initial submission to try and get some feedback from other API devs.. Tomas, I'm looking at you here ;P
Comment 4 Martin Renvoize (ashimema) 2024-08-07 10:35:03 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize (ashimema) 2024-08-07 10:35:06 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 2024-08-07 10:35:09 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2024-08-08 08:33:10 UTC
Created attachment 170152 [details] [review]
Bug 37256: Defined 'context' of circulation rules

This is a follow-up to the previous bug exposing circulation rules over
the API.

We formally define a definition for a circulation rules set including a
new 'context' object the defines the context, library_id,
patron_category_id and item_type_id combination of the rules returned.

This is just a patch I missed in the last submission that I'd meant to
add and it's important for the PUT part of this patchset.
Comment 8 Martin Renvoize (ashimema) 2024-08-08 08:33:13 UTC
Created attachment 170153 [details] [review]
Bug 37256: Unit tests for set_rules

This patch adds unit tests for the to be introduced set_rules endpoint
for setting circualtion rule sets.
Comment 9 Martin Renvoize (ashimema) 2024-08-08 08:33:16 UTC
Created attachment 170154 [details] [review]
Bug 37256: Add 'PUT' for circulation rule sets
Comment 10 Martin Renvoize (ashimema) 2024-08-15 07:52:01 UTC
Created attachment 170335 [details] [review]
Bug 37256: Defined 'context' of circulation rules

This is a follow-up to the previous bug exposing circulation rules over
the API.

We formally define a definition for a circulation rules set including a
new 'context' object the defines the context, library_id,
patron_category_id and item_type_id combination of the rules returned.

This is just a patch I missed in the last submission that I'd meant to
add and it's important for the PUT part of this patchset.
Comment 11 Martin Renvoize (ashimema) 2024-08-15 07:52:04 UTC
Created attachment 170336 [details] [review]
Bug 37256: Unit tests for set_rules

This patch adds unit tests for the to be introduced set_rules endpoint
for setting circualtion rule sets.
Comment 12 Martin Renvoize (ashimema) 2024-08-15 07:52:06 UTC
Created attachment 170337 [details] [review]
Bug 37256: Add 'PUT' for circulation rule sets
Comment 13 Martin Renvoize (ashimema) 2024-08-15 07:52:09 UTC
Created attachment 170338 [details] [review]
Bug 37256: Ensure empty and null work as expected in PUT
Comment 14 Martin Renvoize (ashimema) 2024-09-19 13:10:44 UTC
Created attachment 171719 [details] [review]
Bug 37256: Defined 'context' of circulation rules

This is a follow-up to the previous bug exposing circulation rules over
the API.

We formally define a definition for a circulation rules set including a
new 'context' object the defines the context, library_id,
patron_category_id and item_type_id combination of the rules returned.

This is just a patch I missed in the last submission that I'd meant to
add and it's important for the PUT part of this patchset.
Comment 15 Martin Renvoize (ashimema) 2024-09-19 13:10:46 UTC
Created attachment 171720 [details] [review]
Bug 37256: Unit tests for set_rules

This patch adds unit tests for the to be introduced set_rules endpoint
for setting circualtion rule sets.
Comment 16 Martin Renvoize (ashimema) 2024-09-19 13:10:49 UTC
Created attachment 171721 [details] [review]
Bug 37256: Add 'PUT' for circulation rule sets
Comment 17 Martin Renvoize (ashimema) 2024-09-19 13:10:51 UTC
Created attachment 171722 [details] [review]
Bug 37256: Ensure empty and null work as expected in PUT
Comment 18 Martin Renvoize (ashimema) 2024-09-19 13:16:38 UTC
Created attachment 171723 [details] [review]
Bug 37256: Defined 'context' of circulation rules

This is a follow-up to the previous bug exposing circulation rules over
the API.

We formally define a definition for a circulation rules set including a
new 'context' object the defines the context, library_id,
patron_category_id and item_type_id combination of the rules returned.

This is just a patch I missed in the last submission that I'd meant to
add and it's important for the PUT part of this patchset.

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Comment 19 Martin Renvoize (ashimema) 2024-09-19 13:16:41 UTC
Created attachment 171724 [details] [review]
Bug 37256: Unit tests for set_rules

This patch adds unit tests for the to be introduced set_rules endpoint
for setting circulation rule sets.

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Comment 20 Martin Renvoize (ashimema) 2024-09-19 13:16:43 UTC
Created attachment 171725 [details] [review]
Bug 37256: Add 'PUT' for circulation rule sets

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Comment 21 Martin Renvoize (ashimema) 2024-09-19 13:16:46 UTC
Created attachment 171726 [details] [review]
Bug 37256: Ensure empty and null work as expected in PUT

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Comment 22 Martin Renvoize (ashimema) 2024-09-19 13:17:43 UTC
Thoroughly tested as part of testing bug 10190.
Comment 23 Kyle M Hall (khall) 2025-01-17 14:11:55 UTC
Created attachment 176728 [details] [review]
Bug 37256: Defined 'context' of circulation rules

This is a follow-up to the previous bug exposing circulation rules over
the API.

We formally define a definition for a circulation rules set including a
new 'context' object the defines the context, library_id,
patron_category_id and item_type_id combination of the rules returned.

This is just a patch I missed in the last submission that I'd meant to
add and it's important for the PUT part of this patchset.

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Kyle M Hall (khall) 2025-01-17 14:12:04 UTC
Created attachment 176729 [details] [review]
Bug 37256: Unit tests for set_rules

This patch adds unit tests for the to be introduced set_rules endpoint
for setting circulation rule sets.

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 25 Kyle M Hall (khall) 2025-01-17 14:12:07 UTC
Created attachment 176730 [details] [review]
Bug 37256: Add 'PUT' for circulation rule sets

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 26 Kyle M Hall (khall) 2025-01-17 14:12:08 UTC
Created attachment 176731 [details] [review]
Bug 37256: Ensure empty and null work as expected in PUT

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 27 Katrin Fischer 2025-02-18 09:40:16 UTC
Rebased using the auto_rebase.pl script.
Comment 28 Katrin Fischer 2025-02-18 09:56:21 UTC
Pushed for 25.05!

Well done everyone, thank you!