Repository navigation
Expand file tree
/
Copy pathorder.raml
More file actions
161 lines (153 loc) · 6.4 KB
/
Copy pathorder.raml
File metadata and controls
161 lines (153 loc) · 6.4 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
#%RAML 1.0
title: Orders
baseUri: https://github.com/folio-org/mod-orders
version: v8.1
protocols: [ HTTP, HTTPS ]
documentation:
- title: Orders Business Logic API
content: <b>API for managing purchase orders</b>
types:
composite-purchase-order: !include acq-models/mod-orders/schemas/composite_purchase_order.json
purchase-order-collection: !include acq-models/mod-orders-storage/schemas/purchase_order_collection.json
purchase_order: !include acq-models/mod-orders-storage/schemas/purchase_order.json
fiscal-year-collection: !include acq-models/mod-finance/schemas/fiscal_year_collection.json
fiscal-years-holder: !include acq-models/mod-orders/schemas/fiscal_years_holder.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}$
# workaround to prevent api-lint errors for FQM vendor extensions
# see https://github.com/folio-org/fqm-tools/blob/main/docs/generation/field-schema.md#raml-validation-errors
annotationTypes:
fqm-essential:
type: boolean
fqm-visibility:
type: string
fqm-visible-by-default:
type: boolean
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 rtypes/collection-with-json-response.raml
collection-item: !include rtypes/item-collection-with-json-response.raml
post-empty-body: !include raml-util/rtypes/post-empty-body.raml
/orders/composite-orders:
displayName: Orders
type:
collection:
exampleCollection: !include acq-models/mod-orders-storage/examples/purchase_order_collection.sample
exampleItem: !include acq-models/mod-orders/examples/composite_purchase_order.sample
schemaCollection: purchase-order-collection
schemaItem: composite-purchase-order
is: [validate]
get:
is: [pageable, searchable: {description: "using CQL (indexes for purchase orders)", example: "workflow_status==\"Pending\""} ]
post:
description: Post a purchase order (PO) and a number of PO lines; record fund transactions corresponding to the order. Only in case an acquisition unit has to be assigned to the Order it is required that user should have extra permission orders.acquisitions-units-assignments.item.post to create an purchase order.
/{id}:
uriParameters:
id:
description: The UUID of a purchase order
type: UUID
type:
collection-item:
exampleItem: !include acq-models/mod-orders/examples/composite_purchase_order.sample
schema: composite-purchase-order
is: [validate]
get:
description: Return a purchase order with given {id}
queryParameters:
fiscalYearId:
displayName: Fiscal Year ID
type: UUID
required: false
description: Filter order by fiscal year ID
put:
description: |
Update a purchase order with given {id}
- if request does not include po_lines or includes "po_lines": [] or "po_lines": null - update just purchase order summary
- if request includes array of "po_lines" - update PO lines as per request
queryParameters:
deleteHoldings:
displayName: The associated holding & Items should be removed
type: boolean
example: true
required: false
default: false
delete:
description: Delete a purchase order with given {id}
/re-encumber:
post:
responses:
204:
description: "Re-encumber completed successfully"
400:
description: "Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response."
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: |
"unable to add <<resourcePathName|!singularize>> -- malformed JSON at 13:3"
404:
description: "Item with a given ID not found"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: |
"<<resourcePathName|!singularize>> not found"
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: "Internal server error, contact administrator"
/fiscal-years:
get:
description: Get available fiscal years for a purchase order
responses:
200:
description: "Fiscal years retrieved successfully"
body:
application/json:
type: fiscal-years-holder
example:
strict: false
value: !include acq-models/mod-orders/examples/fiscal_years_holder.sample
400:
description: "Bad request"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: "Bad request"
404:
description: "Order not found"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: "Order not found"
500:
description: "Internal server error"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: "Internal server error, contact administrator"