From 989500a26fc4bf1034dac6669c48ba13d4b50135 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 28 Feb 2020 14:45:44 -0500 Subject: [PATCH] Bug 24860: Implement reserves.volume_id Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Rebecca Coert --- C4/Reserves.pm | 2 ++ Koha/REST/V1/Holds.pm | 2 ++ api/v1/swagger/definitions/hold.json | 4 ++++ api/v1/swagger/paths/holds.json | 10 ++++++++++ 4 files changed, 18 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index fbd42f0be4..9786458816 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -186,6 +186,7 @@ sub AddReserve { my $found = $params->{found}; my $itemtype = $params->{itemtype}; my $non_priority = $params->{non_priority}; + my $volume_id = $params->{volume_id}; $resdate = output_pref( { str => dt_from_string( $resdate ), dateonly => 1, dateformat => 'iso' }) or output_pref({ dt => dt_from_string, dateonly => 1, dateformat => 'iso' }); @@ -239,6 +240,7 @@ sub AddReserve { { borrowernumber => $borrowernumber, biblionumber => $biblionumber, + volume_id => $volume_id, reservedate => $resdate, branchcode => $branch, priority => $priority, diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index 60acb5ad61..45da7a1ac3 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -67,6 +67,7 @@ sub add { my $biblio; my $biblio_id = $body->{biblio_id}; + my $volume_id = $body->{volume_id}; my $pickup_library_id = $body->{pickup_library_id}; my $item_id = $body->{item_id}; my $patron_id = $body->{patron_id}; @@ -176,6 +177,7 @@ sub add { found => undef, # TODO: Why not? itemtype => $item_type, non_priority => $non_priority, + volume_id => $volume_id, } ); diff --git a/api/v1/swagger/definitions/hold.json b/api/v1/swagger/definitions/hold.json index 6a018e916f..6ff6028caf 100644 --- a/api/v1/swagger/definitions/hold.json +++ b/api/v1/swagger/definitions/hold.json @@ -18,6 +18,10 @@ "type": "integer", "description": "Internal biblio identifier" }, + "volume_id": { + "type": ["integer", "null"], + "description": "Internal volume identifier for the volume to place on hold" + }, "pickup_library_id": { "type": ["string", "null"], "description": "Internal library identifier for the pickup library" diff --git a/api/v1/swagger/paths/holds.json b/api/v1/swagger/paths/holds.json index 3792985c8c..0da318f1d9 100644 --- a/api/v1/swagger/paths/holds.json +++ b/api/v1/swagger/paths/holds.json @@ -30,6 +30,12 @@ "description": "Internal biblio identifier", "type": "integer" }, + { + "name": "volume_id", + "in": "query", + "description": "Internal volume identifier for the volume to place on hold", + "type": "integer" + }, { "name": "pickup_library_id", "in": "query", @@ -187,6 +193,10 @@ "description": "Internal biblio identifier", "type": [ "integer", "null" ] }, + "volume_id": { + "description": "Internal volume identifier for the volume to place on hold", + "type": [ "integer", "null" ] + }, "item_id": { "description": "Internal item identifier", "type": [ "integer", "null" ] -- 2.24.1 (Apple Git-126)