Lines 63-68
Link Here
|
63 |
} |
63 |
} |
64 |
} |
64 |
} |
65 |
} |
65 |
} |
|
|
66 |
}, |
67 |
"/borrowers/{borrowernumber}/reserves": { |
68 |
"get": { |
69 |
"x-mojo-controller": "Koha::REST::V1::Borrowers::Reserves", |
70 |
"operationId": "listBorrowerReserves", |
71 |
"tags": ["borrowers", "reserves"], |
72 |
"parameters": [ |
73 |
{ "$ref": "#/parameters/borrowernumberPathParam" } |
74 |
], |
75 |
"produces": ["application/json"], |
76 |
"responses": { |
77 |
"200": { |
78 |
"description": "A list of reserves", |
79 |
"schema": { "$ref": "#/definitions/reserves" } |
80 |
}, |
81 |
"404": { |
82 |
"description": "Borrower not found", |
83 |
"schema": { "$ref": "#/definitions/error" } |
84 |
} |
85 |
} |
86 |
}, |
87 |
"post": { |
88 |
"x-mojo-controller": "Koha::REST::V1::Borrowers::Reserves", |
89 |
"operationId": "addBorrowerReserve", |
90 |
"tags": ["borrowers", "reserves"], |
91 |
"parameters": [ |
92 |
{ "$ref": "#/parameters/borrowernumberPathParam" }, |
93 |
{ |
94 |
"name": "body", |
95 |
"in": "body", |
96 |
"description": "A JSON object containing informations about the new reserve", |
97 |
"required": true, |
98 |
"schema": { "$ref": "#/definitions/newBorrowerReserveBody" } |
99 |
} |
100 |
], |
101 |
"consumes": ["application/json"], |
102 |
"produces": ["application/json"], |
103 |
"responses": { |
104 |
"201": { |
105 |
"description": "Created reserve", |
106 |
"schema": { "$ref": "#/definitions/reserve" } |
107 |
}, |
108 |
"400": { |
109 |
"description": "Missing or wrong parameters", |
110 |
"schema": { "$ref": "#/definitions/error" } |
111 |
}, |
112 |
"403": { |
113 |
"description": "Reserve not allowed", |
114 |
"schema": { "$ref": "#/definitions/error" } |
115 |
}, |
116 |
"404": { |
117 |
"description": "Borrower not found", |
118 |
"schema": { "$ref": "#/definitions/error" } |
119 |
}, |
120 |
"500": { |
121 |
"description": "Internal error", |
122 |
"schema": { "$ref": "#/definitions/error" } |
123 |
} |
124 |
} |
125 |
} |
126 |
}, |
127 |
"/reserves/{reserve_id}": { |
128 |
"put": { |
129 |
"x-mojo-controller": "Koha::REST::V1::Reserves", |
130 |
"operationId": "editReserve", |
131 |
"tags": ["reserves"], |
132 |
"parameters": [ |
133 |
{ "$ref": "#/parameters/reserveIdPathParam" }, |
134 |
{ |
135 |
"name": "body", |
136 |
"in": "body", |
137 |
"description": "A JSON object containing fields to modify", |
138 |
"required": true, |
139 |
"schema": { "$ref": "#/definitions/editReserveBody" } |
140 |
} |
141 |
], |
142 |
"consumes": ["application/json"], |
143 |
"produces": ["application/json"], |
144 |
"responses": { |
145 |
"200": { |
146 |
"description": "Updated reserve", |
147 |
"schema": { "$ref": "#/definitions/reserve" } |
148 |
}, |
149 |
"400": { |
150 |
"description": "Missing or wrong parameters", |
151 |
"schema": { "$ref": "#/definitions/error" } |
152 |
}, |
153 |
"404": { |
154 |
"description": "Reserve not found", |
155 |
"schema": { "$ref": "#/definitions/error" } |
156 |
} |
157 |
} |
158 |
}, |
159 |
"delete": { |
160 |
"x-mojo-controller": "Koha::REST::V1::Reserves", |
161 |
"operationId": "deleteReserve", |
162 |
"tags": ["reserves"], |
163 |
"parameters": [ |
164 |
{ "$ref": "#/parameters/reserveIdPathParam" } |
165 |
], |
166 |
"produces": ["application/json"], |
167 |
"responses": { |
168 |
"204": { |
169 |
"description": "No content", |
170 |
"schema": { |
171 |
"type": "null" |
172 |
} |
173 |
}, |
174 |
"404": { |
175 |
"description": "Reserve not found", |
176 |
"schema": { "$ref": "#/definitions/error" } |
177 |
} |
178 |
} |
179 |
} |
66 |
} |
180 |
} |
67 |
}, |
181 |
}, |
68 |
"definitions": { |
182 |
"definitions": { |
Lines 83-91
Link Here
|
83 |
} |
197 |
} |
84 |
} |
198 |
} |
85 |
}, |
199 |
}, |
|
|
200 |
"reserves": { |
201 |
"type": "array", |
202 |
"items": { "$ref": "#/definitions/reserve" } |
203 |
}, |
204 |
"reserve": { |
205 |
"type": "object", |
206 |
"properties": { |
207 |
"reserve_id": { |
208 |
"description": "Internal reserve identifier" |
209 |
}, |
210 |
"borrowernumber": { "$ref" : "#/definitions/borrowernumber" }, |
211 |
"reservedate": { |
212 |
"description": "the date the reserve was placed" |
213 |
}, |
214 |
"biblionumber": { "$ref": "#/definitions/biblionumber" }, |
215 |
"constrainttype": { |
216 |
"description": "type of constraint" |
217 |
}, |
218 |
"branchcode": { "$ref": "#/definitions/branchcode" }, |
219 |
"notificationdate": { |
220 |
"description": "currently unused" |
221 |
}, |
222 |
"reminderdate": { |
223 |
"description": "currently unused" |
224 |
}, |
225 |
"cancellationdate": { |
226 |
"description": "the date the reserve was cancelled" |
227 |
}, |
228 |
"reservenotes": { |
229 |
"description": "notes related to this reserve" |
230 |
}, |
231 |
"priority": { |
232 |
"description": "where in the queue the patron sits" |
233 |
}, |
234 |
"found": { |
235 |
"description": "a one letter code defining what the status of the reserve is after it has been confirmed" |
236 |
}, |
237 |
"timestamp": { |
238 |
"description": "date and time the reserve was last updated" |
239 |
}, |
240 |
"itemnumber": { "$ref": "#/definitions/itemnumber" }, |
241 |
"waitingdate": { |
242 |
"description": "the date the item was marked as waiting for the patron at the library" |
243 |
}, |
244 |
"expirationdate": { |
245 |
"description": "the date the reserve expires" |
246 |
}, |
247 |
"lowestPriority": { |
248 |
"description": "" |
249 |
}, |
250 |
"suspend": { |
251 |
"description": "" |
252 |
}, |
253 |
"suspend_until": { |
254 |
"description": "" |
255 |
} |
256 |
} |
257 |
}, |
258 |
"newBorrowerReserveBody": { |
259 |
"type": "object", |
260 |
"properties": { |
261 |
"biblionumber": { |
262 |
"description": "Biblio internal identifier", |
263 |
"type": "integer" |
264 |
}, |
265 |
"itemnumber": { |
266 |
"description": "Item internal identifier", |
267 |
"type": "integer" |
268 |
}, |
269 |
"branchcode": { |
270 |
"description": "Pickup location", |
271 |
"type": "string", |
272 |
"required": true |
273 |
}, |
274 |
"expirationdate": { |
275 |
"description": "Reserve end date", |
276 |
"type": "string", |
277 |
"format": "date" |
278 |
} |
279 |
} |
280 |
}, |
281 |
"editReserveBody": { |
282 |
"type": "object", |
283 |
"properties": { |
284 |
"priority": { |
285 |
"description": "Position in waiting queue", |
286 |
"type": "integer", |
287 |
"minimum": 1 |
288 |
}, |
289 |
"branchcode": { |
290 |
"description": "Pickup location", |
291 |
"type": "string" |
292 |
}, |
293 |
"suspend_until": { |
294 |
"description": "Suspend until", |
295 |
"type": "string", |
296 |
"format": "date" |
297 |
} |
298 |
} |
299 |
}, |
300 |
"biblionumber": { |
301 |
"description": "Biblio internal identifier" |
302 |
}, |
86 |
"borrowernumber": { |
303 |
"borrowernumber": { |
87 |
"description": "Borrower internal identifier" |
304 |
"description": "Borrower internal identifier" |
88 |
}, |
305 |
}, |
|
|
306 |
"branchcode": { |
307 |
"description": "Branch code" |
308 |
}, |
309 |
"itemnumber": { |
310 |
"description": "Item internal identifier" |
311 |
}, |
89 |
"error": { |
312 |
"error": { |
90 |
"type": "object", |
313 |
"type": "object", |
91 |
"properties": { |
314 |
"properties": { |
Lines 101-107
Link Here
|
101 |
"name": "borrowernumber", |
324 |
"name": "borrowernumber", |
102 |
"in": "path", |
325 |
"in": "path", |
103 |
"description": "Internal borrower identifier", |
326 |
"description": "Internal borrower identifier", |
104 |
"required": "true", |
327 |
"required": true, |
|
|
328 |
"type": "integer" |
329 |
}, |
330 |
"reserveIdPathParam": { |
331 |
"name": "reserve_id", |
332 |
"in": "path", |
333 |
"description": "Internal reserve identifier", |
334 |
"required": true, |
105 |
"type": "integer" |
335 |
"type": "integer" |
106 |
} |
336 |
} |
107 |
} |
337 |
} |