Bug 18403: REST API - patrons endpoint
[koha.git] / api / v1 / swagger / paths / holds.json
index 9e7ec34..6bbcd40 100644 (file)
@@ -1,8 +1,9 @@
 {
   "/holds": {
     "get": {
+      "x-mojo-to": "Hold#list",
       "operationId": "listHolds",
-      "tags": ["borrowers", "holds"],
+      "tags": ["patrons", "holds"],
       "parameters": [
         {
           "name": "reserve_id",
             "$ref": "../definitions.json#/holds"
           }
         },
+        "401": {
+          "description": "Authentication required",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "403": {
+          "description": "Hold not allowed",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
         "404": {
           "description": "Borrower 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": {
         "allow-owner": true,
         "allow-guarantor": true,
         "permissions": {
-          "borrowers": "1"
+          "borrowers": "edit_borrowers"
         }
       }
     },
     "post": {
+      "x-mojo-to": "Hold#add",
       "operationId": "addHold",
-      "tags": ["borrowers", "holds"],
+      "tags": ["patrons", "holds"],
       "parameters": [{
           "name": "body",
           "in": "body",
                 "description": "Hold end date",
                 "type": "string",
                 "format": "date"
+              },
+              "itemtype": {
+                "description": "Limit hold on one itemtype (ignored for item-level holds)",
+                "type": "string"
               }
             }
           }
             "$ref": "../definitions.json#/error"
           }
         },
+        "401": {
+          "description": "Authentication required",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
         "403": {
           "description": "Hold not allowed",
           "schema": {
           }
         },
         "500": {
-          "description": "Internal error",
+          "description": "Internal server error",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "503": {
+          "description": "Under maintenance",
           "schema": {
             "$ref": "../definitions.json#/error"
           }
   },
   "/holds/{reserve_id}": {
     "put": {
+      "x-mojo-to": "Hold#edit",
       "operationId": "editHold",
       "tags": ["holds"],
       "parameters": [{
             "$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": {
       }
     },
     "delete": {
+      "x-mojo-to": "Hold#delete",
       "operationId": "deleteHold",
       "tags": ["holds"],
       "parameters": [{
             "type": "object"
           }
         },
+        "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": {