a902efb83b
This patch adds an endpoint in thi api in /api/v1/clubs/{club_id}/holds whith the verb POST that maps to Koha::REST::V1::Clubs::Holds#add controller. Classes for club_holds and club_holds_to_patron_holds new tables where also added. To test: 1) Reach SUCCESS.3 test point of previous patch with club that has no enrollments 2) Click on "Place Hold" SUCCESS => an alert should appear that you cannot place hold on a club without patrons 3) Reach SUCCESS.3 test point of previous patch with club that has enrollments 4) Click on "Place Hold" SUCCESS => holds priority list should appear with holds for every patron in club 5) Repeat steps 3 and 4. SUCCESS => new holds should appear in different order 6) Sign off Sponsored-by: Southeast Kansas Library - SEKLS Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
100 lines
No EOL
3.4 KiB
JSON
100 lines
No EOL
3.4 KiB
JSON
{
|
|
"/clubs/{club_id}/holds": {
|
|
"post": {
|
|
"x-mojo-to": "Clubs::Holds#add",
|
|
"operationId": "addClubHold",
|
|
"tags": ["holds", "clubs"],
|
|
"parameters": [{
|
|
"$ref": "../parameters.json#/club_id_pp"
|
|
}, {
|
|
"name": "body",
|
|
"in": "body",
|
|
"description": "A JSON object containing informations about the new hold",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"biblio_id": {
|
|
"description": "Internal biblio identifier",
|
|
"type": [ "integer", "null" ]
|
|
},
|
|
"item_id": {
|
|
"description": "Internal item identifier",
|
|
"type": [ "integer", "null" ]
|
|
},
|
|
"pickup_library_id": {
|
|
"description": "Internal library identifier for the pickup library",
|
|
"type": "string"
|
|
},
|
|
"expiration_date": {
|
|
"description": "Hold end date",
|
|
"type": ["string", "null"],
|
|
"format": "date"
|
|
},
|
|
"notes": {
|
|
"description": "Notes related to this hold",
|
|
"type": [ "string", "null" ]
|
|
},
|
|
"item_type": {
|
|
"description": "Limit hold on one itemtype (ignored for item-level holds)",
|
|
"type": [ "string", "null" ]
|
|
}
|
|
},
|
|
"required": [ "pickup_library_id" ]
|
|
}
|
|
}
|
|
],
|
|
"consumes": ["application/json"],
|
|
"produces": ["application/json"],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created hold",
|
|
"schema": {
|
|
"$ref": "../definitions/club_hold.json"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Missing or wrong parameters",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Authentication required",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Hold not allowed",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Hold not found",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Under maintenance",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"reserveforothers": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |