Bug 16213

Summary: Allow to select hold's itemtype when using API
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: REST APIAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: enhancement    
Priority: P5 - low CC: andreas.hedstrom.mace, benjamin.rokseth, jonathan.druart, josef.moravec, kyle, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13903, 15533    
Bug Blocks:    
Attachments: Bug 16213: Allow to select hold's itemtype when using API
Bug 16213: Allow to select hold's itemtype when using API
Bug 16213: Allow to select hold's itemtype when using API
Bug 16213: Allow to select hold's itemtype when using API
Bug 16213: (QA follow-up) Fix terminology

Description Julian Maurice 2016-04-06 11:31:16 UTC
Bug 15533 bring the capability to select an itemtype for a title-level hold in staff and OPAC.

This should be possible through the API too.
Comment 1 Julian Maurice 2016-04-06 11:31:54 UTC Comment hidden (obsolete)
Comment 2 Benjamin Rokseth 2016-04-07 10:55:21 UTC
Works beautifully, all tests pass.

Optionally, perhaps a check for valid itemtype? Anyways, that shouldn't be a showstopper.
Comment 3 Benjamin Rokseth 2016-04-07 10:56:16 UTC
Created attachment 50017 [details] [review]
Bug 16213: Allow to select hold's itemtype when using API

Depends on bug 15533 and bug 13903

Test plan:
1/ Use your usual "REST testing" tool to place a title-level hold with
an itemtype. The request should look like this:

POST /api/v1/reserves
{
    "borrowernumber": 1234,
    "biblionumber": 456,
    "branchcode": "CPL",
    "itemtype": "A"
}

2/ Check that the hold was placed and the itemtype is correctly selected
3/ prove t/db_dependent/api/v1/reserves.t

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Comment 4 Kyle M Hall 2016-06-24 18:41:12 UTC
prove t/db_dependent/api/v1/holds.t
t/db_dependent/api/v1/holds.t .. 1/39
#   Failed test '200 OK'
#   at t/db_dependent/api/v1/holds.t line 135.
#          got: '404'
#     expected: '200'

#   Failed test '201 Created'
#   at t/db_dependent/api/v1/holds.t line 145.
#          got: '404'
#     expected: '201'
Comment 5 Julian Maurice 2017-10-16 13:06:36 UTC
Created attachment 68179 [details] [review]
Bug 16213: Allow to select hold's itemtype when using API

Test plan:
1/ Use your usual "REST testing" tool to place a title-level hold with
an itemtype. The request should look like this:

POST /api/v1/holds
{
    "borrowernumber": 1234,
    "biblionumber": 456,
    "branchcode": "CPL",
    "itemtype": "A"
}

2/ Check that the hold was placed and the itemtype is correctly selected
3/ prove t/db_dependent/api/v1/holds.t

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Comment 6 Julian Maurice 2017-10-16 13:07:00 UTC
Patch rebased on master
Comment 7 Josef Moravec 2018-01-26 09:30:03 UTC
Created attachment 70942 [details] [review]
Bug 16213: Allow to select hold's itemtype when using API

Test plan:
1/ Use your usual "REST testing" tool to place a title-level hold with
an itemtype. The request should look like this:

POST /api/v1/holds
{
    "borrowernumber": 1234,
    "biblionumber": 456,
    "branchcode": "CPL",
    "itemtype": "A"
}

2/ Check that the hold was placed and the itemtype is correctly selected
3/ prove t/db_dependent/api/v1/holds.t

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Josef Moravec 2018-01-26 09:30:06 UTC
Created attachment 70943 [details] [review]
Bug 16213: (QA follow-up) Fix terminology

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 9 Jonathan Druart 2018-01-30 17:25:45 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 10 Nick Clemens 2018-02-02 15:13:36 UTC
Awesome work all! Enhancement, not backporting to 17.11.x