-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathcirculation.raml
More file actions
369 lines (363 loc) · 11.8 KB
/
Copy pathcirculation.raml
File metadata and controls
369 lines (363 loc) · 11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
#%RAML 1.0
title: Circulation
version: v14.2
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost:9130
documentation:
- title: Circulation Business Logic API
content: <b>API for loans and requests</b>
types:
loan: !include loan.json
loans: !include loans.json
request: !include request.json
requests: !include requests.json
check-in-by-barcode-response: !include check-in-by-barcode-response.json
error: !include extended-error.json
errors: !include extended-errors.json
traits:
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
validate: !include raml-util/traits/validation.raml
resourceTypes:
collection: !include raml-util/rtypes/collection.raml
collection-get: !include raml-util/rtypes/collection-get.raml
collection-item: !include raml-util/rtypes/item-collection.raml
/circulation:
/check-out-by-barcode:
displayName: Check out using barcode for item and loanee
post:
description: Creates a loan by checking out an item to a loanee
is: [
validate
]
body:
application/json:
type: !include check-out-by-barcode-request.json
example: !include examples/check-out-by-barcode-request.json
responses:
201:
body:
application/json:
type: loan
example: !include examples/loan.json
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/renew-by-barcode:
displayName: Renew an existing loan using barcode for item and loanee
post:
description: Updates the due date of an existing loan
is: [
validate
]
body:
application/json:
type: !include renew-by-barcode-request.json
example: !include examples/renew-by-barcode-request.json
responses:
200:
body:
application/json:
type: loan
example: !include examples/loan.json
201:
body:
application/json:
type: loan
example: !include examples/loan.json
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/renew-by-id:
displayName: Renew an existing loan using IDs of the item and loanee
post:
description: Updates the due date of an existing loan
is: [
validate
]
body:
application/json:
type: !include renew-by-id-request.json
example: !include examples/renew-by-id-request.json
responses:
200:
body:
application/json:
type: loan
example: !include examples/loan.json
201:
body:
application/json:
type: loan
example: !include examples/loan.json
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/check-in-by-barcode:
displayName: Checkin an existing loan using barcode for item and loanee
post:
description: Updates the status of an existing loan
is: [
validate
]
body:
application/json:
type: !include check-in-by-barcode-request.json
example: !include examples/check-in-by-barcode-request.json
responses:
200:
body:
application/json:
type: check-in-by-barcode-response
example: !include examples/check-in-by-barcode-response.json
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/loans:
displayName: Loans
type:
collection:
exampleCollection: !include examples/loans.json
exampleItem: !include examples/loan.json
schemaCollection: loans
schemaItem: loan
get:
is: [
pageable,
searchable: {description: "by title (using CQL)",
example: "userId=\"cf23adf0-61ba-4887-bf82-956c4aae2260\""}
]
responses:
501:
description: "Not implemented yet"
post:
delete:
responses:
204:
description: "All loans deleted"
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
text/plain:
example: "Internal server error, contact administrator"
/{loanId}:
type:
collection-item:
exampleItem: !include examples/loan.json
schema: loan
get:
responses:
501:
description: "Not implemented yet"
put:
responses:
501:
description: "Not implemented yet"
delete:
responses:
501:
description: "Not implemented yet"
/requests:
displayName: Requests
type:
collection:
exampleCollection: !include examples/requests.json
exampleItem: !include examples/request.json
schemaCollection: requests
schemaItem: request
get:
is: [pageable,
searchable: {description: "by using CQL",
example: "requesterId=\"cf23adf0-61ba-4887-bf82-956c4aae2260\""}
]
responses:
501:
description: "Not implemented yet"
post:
responses:
501:
description: "Not implemented yet"
delete:
responses:
204:
description: "All requests deleted"
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
text/plain:
example: "Internal server error, contact administrator"
501:
description: "Not implemented yet"
/{requestId}:
type:
collection-item:
exampleItem: !include examples/request.json
schema: request
get:
responses:
501:
description: "Not implemented yet"
put:
responses:
501:
description: "Not implemented yet"
delete:
responses:
501:
description: "Not implemented yet"
/queue:
/instance:
/{instanceId}:
type:
collection-get:
exampleCollection: !include examples/request-queue.json
schemaCollection: requests
get:
/reorder:
post:
description: Reorder requests in the instance queue
body:
application/json:
type: !include schema/reorder-queue.json
example: !include examples/reorder-queue.json
responses:
200:
description: "Queue has been reordered successfully"
body:
application/json:
type: requests
example: !include examples/requests.json
422:
description: "Validation errors."
body:
text/plain:
example: "Page requests can not be displaced from position 1."
404:
description: "Queue for item not found."
500:
description: "Internal server error."
body:
text/plain:
example: "Internal server error."
/item:
/{itemId}:
type:
collection-get:
exampleCollection: !include examples/request-queue.json
schemaCollection: requests
get:
/reorder:
post:
description: Reorder requests in the item queue
body:
application/json:
type: !include schema/reorder-queue.json
example: !include examples/reorder-queue.json
responses:
200:
description: "Queue has been reordered successfully"
body:
application/json:
type: requests
example: !include examples/requests.json
422:
description: "Validation errors."
body:
text/plain:
example: "Page requests can not be displaced from position 1."
404:
description: "Queue for item not found."
500:
description: "Internal server error."
body:
text/plain:
example: "Internal server error."
/instances:
displayName: Instance level requests
post:
description: Creates a request for any item from the given instance ID
is: [
validate
]
body:
application/json:
type: !include request-by-instance-id.json
example: !include examples/request-by-instance-id.json
responses:
201:
body:
application/json:
type: request
example: !include examples/request.json
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/allowed-service-points:
displayName: Allowed pickup service points by request type
get:
description: Get allowed pickup service points grouped by request type
queryString:
minProperties: 2
maxProperties: 2
properties:
operation:
description: "Operation (create, replace or move)"
type: string
enum: [create, replace, move]
required: false
requestId:
description: "Request ID"
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
required: false
requesterId:
description: "Requester ID"
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
required: false
itemId:
description: "Item ID"
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
required: false
instanceId:
description: "Instance ID"
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
required: false
useStubItem:
description: "When true, allows to apply circulation rules based on patron group only"
type: boolean
required: false
ecsRequestRouting:
description: "When true, returns only service points with ecsRequestRouting"
type: boolean
required: false
responses:
200:
description: "List of allowed service points was retrieved successfully"
body:
application/json:
type: !include allowed-service-points-response.json
example: !include examples/allowed-service-points-response.json
400:
description: "Invalid request"
body:
text/plain:
example: "Request query parameters must contain 'requester'"
422:
description: "Validation failure"
body:
text/plain:
example: "Validation failed"
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"