Bug 27898

Summary: Make PUT /holds/:hold_id handle x-koha-override for pickup locations
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: REST APIAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: CLOSED FIXED QA Contact: Nick Clemens (kidclamp) <nick>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:
Bug Depends on: 27797    
Bug Blocks: 27865, 28254    
Attachments: Bug 27898: Unit tests
Bug 27898: Make PUT /holds/:hold_id accept overrides
Bug 27898: Unit tests
Bug 27898: Make PUT /holds/:hold_id accept overrides
Bug 27898: Unit tests
Bug 27898: Make PUT /holds/:hold_id accept overrides

Description Tomás Cohen Arazi (tcohen) 2021-03-08 16:02:38 UTC
We need this so the UI can use the PUT route effectively. This is a follow-up for bug 27797 and needed on its descendents tree.
Comment 1 Tomás Cohen Arazi (tcohen) 2021-03-08 16:09:33 UTC
Created attachment 117935 [details] [review]
Bug 27898: Unit tests

This patch adds unit tests for the PUT /holds/:hold_id route so it
accepts the x-koha-override header and is able to override pickup
location constraints.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2021-03-08 16:09:37 UTC
Created attachment 117936 [details] [review]
Bug 27898: Make PUT /holds/:hold_id accept overrides

This patch makes the route handle overriding pickup locations by passing
the 'x-koha-override' header (set to 'any').

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, because things cannot be overridden ATM.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Andrew Fuerste-Henry 2021-03-08 17:37:01 UTC
Created attachment 117939 [details] [review]
Bug 27898: Unit tests

This patch adds unit tests for the PUT /holds/:hold_id route so it
accepts the x-koha-override header and is able to override pickup
location constraints.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Andrew Fuerste-Henry 2021-03-08 17:37:03 UTC
Created attachment 117940 [details] [review]
Bug 27898: Make PUT /holds/:hold_id accept overrides

This patch makes the route handle overriding pickup locations by passing
the 'x-koha-override' header (set to 'any').

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, because things cannot be overridden ATM.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2021-04-28 12:19:32 UTC
Created attachment 120268 [details] [review]
Bug 27898: Unit tests

This patch adds unit tests for the PUT /holds/:hold_id route so it
accepts the x-koha-override header and is able to override pickup
location constraints.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens (kidclamp) 2021-04-28 12:19:37 UTC
Created attachment 120269 [details] [review]
Bug 27898: Make PUT /holds/:hold_id accept overrides

This patch makes the route handle overriding pickup locations by passing
the 'x-koha-override' header (set to 'any').

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, because things cannot be overridden ATM.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Jonathan Druart 2021-05-04 13:25:01 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-05-11 12:05:19 UTC
Enhancement not pushed to 20.11.x