-
Notifications
You must be signed in to change notification settings - Fork 7
/
order.raml
99 lines (93 loc) · 3.38 KB
/
order.raml
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
#%RAML 1.0
title: Orders
baseUri: https://github.com/folio-org/mod-orders
version: v1
protocols: [ HTTP, HTTPS ]
documentation:
- title: Orders Business Logic API
content: <b>API for managing purchase orders</b>
types:
composite_purchase_orders: !include acq-models/composite_purchase_orders.json
composite_purchase_order: !include acq-models/composite_purchase_order.json
po_line: !include acq-models/composite_po_line.json
errors: !include raml-util/schemas/errors.schema
UUID:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
traits:
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
language: !include raml-util/traits/language.raml
validate: !include raml-util/traits/validation.raml
auth:
responses:
401:
description: "Not authorized to perform requested action"
body:
text/plain:
example: "unable to create <<resourcePathName|!singularize>> -- unauthorized"
resourceTypes:
collection-item: !include raml-util/rtypes/item-collection.raml
# The post-empty-body.raml does not declare request body but it can be defined when this resource type is used
post-item: !include raml-util/rtypes/post-empty-body.raml
/orders:
displayName: Orders
type:
post-item:
exampleItem: !include acq-models/examples/composite_purchase_order.sample
schema: composite_purchase_order
post:
description: Post a purchase order (PO) and a number of PO lines; record fund transactions corresponding to the order
is: [validate, auth]
body:
application/json:
type: composite_purchase_order
example:
strict: false
value: !include acq-models/examples/composite_purchase_order.sample
/{id}:
uriParameters:
id:
description: The UUID of a purchase order
type: UUID
type:
collection-item:
exampleItem: !include acq-models/examples/composite_purchase_order.sample
schema: composite_purchase_order
put:
description: Update an order by id
is: [validate]
/lines:
displayName: Purchace Order Lines
description: Manage purchase order (PO) lines
type:
# Using `post-item` resource type because at the moment only POST is required. In case GET becomes also required, the `collection` resource type should be used instead
post-item:
exampleItem: !include acq-models/examples/composite_po_line.sample
schema: po_line
post:
displayName: Create a new purchace order line
description: Post a purchase order (PO) line
is: [validate, auth]
body:
application/json:
type: po_line
example:
strict: false
value: !include acq-models/examples/composite_po_line.sample
/{lineId}:
displayName: Purchase Order Line
description: Manage purchase order line (PO line) by id
uriParameters:
lineId:
description: The UUID of a purchase order line
type: UUID
type:
collection-item:
exampleItem: !include acq-models/examples/composite_po_line.sample
schema: po_line
get:
description: Return a purchase order line
is: [validate]
delete:
is: [validate]