-
Notifications
You must be signed in to change notification settings - Fork 5
/
voucher.raml
174 lines (167 loc) · 6.26 KB
/
voucher.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
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
#%RAML 1.0
title: Voucher
version: v2.3
protocols: [ HTTP, HTTPS ]
baseUri: https://github.com/folio-org/mod-invoice
documentation:
- title: Voucher API
content: This documents the API calls that can be made to manage vouchers
types:
sequenceNumber: !include acq-models/common/schemas/sequence_number.json
voucherLine: !include acq-models/mod-invoice-storage/schemas/voucher_line.json
voucherLineCollection: !include acq-models/mod-invoice-storage/schemas/voucher_line_collection.json
voucher: !include acq-models/mod-invoice-storage/schemas/voucher.json
voucherCollection: !include acq-models/mod-invoice-storage/schemas/voucher_collection.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:
validate: !include raml-util/traits/validation.raml
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
resourceTypes:
get-only: !include raml-util/rtypes/get-only-with-json-response.raml
collection-get: !include raml-util/rtypes/collection-get-with-json-response.raml
collection-item: !include raml-util/rtypes/item-collection-get-with-json-response.raml
/voucher:
/vouchers:
displayName: Vouchers
description: Get list of vouchers
type:
get-only:
schema: voucherCollection
exampleCollection: !include acq-models/mod-invoice-storage/examples/voucher_collection.sample
get:
description: Retrieve a list of voucher items.
is: [ pageable, searchable: {description: "using CQL (indexes for voucher)", example: "voucherNumber==\"1000\""}, validate ]
/{id}:
uriParameters:
id:
description: The UUID of an voucher
type: UUID
displayName: voucher
description: Get specific voucher
type:
collection-item:
schema: voucher
exampleItem: !include acq-models/mod-invoice-storage/examples/voucher.sample
get:
description: Return a voucher with given {id}
put:
description: Update a voucher with given {Id}
body:
application/json:
type: voucher
example:
strict: false
value: !include acq-models/mod-invoice-storage/examples/voucher.sample
responses:
204:
description: "Voucher successfully updated"
404:
description: "Voucher with a given ID not found"
body:
text/plain:
example: |
"Voucher not found"
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
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:
text/plain:
example: |
"unable to update Voucher -- malformed JSON at 13:4"
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
text/plain:
example: "internal server error, contact administrator"
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
/voucher-lines:
displayName: Voucher Lines
description: Manage Voucher lines
type:
collection-get:
schemaCollection: voucherLineCollection
exampleCollection: !include acq-models/mod-invoice-storage/examples/voucher_line_collection.sample
get:
description: Retrieve a list of voucher lines.
is: [ pageable, searchable: {description: "using CQL (indexes for voucher line)", example: "amount>==\"10\""}, validate ]
/{id}:
uriParameters:
id:
description: The UUID of a voucher line
type: UUID
displayName: Voucher Lines
description: Get specific voucher lines
is: [validate]
type:
get-only:
schema: voucherLine
exampleCollection: !include acq-models/mod-invoice-storage/examples/voucher_line.sample
get:
description: Return an voucher line with given {id}
put:
description: Update a voucher line with given {id}
body:
application/json:
type: voucherLine
example:
strict: false
value: !include acq-models/mod-invoice-storage/examples/voucher_line.sample
/voucher-number/start/{value}:
displayName: Voucher Number
description: Manage voucher number
is: [validate]
post:
description: (Re)set the start value of the voucher number sequence
responses:
204:
description: "Start value successfully updated"
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
text/plain:
example: "internal server error, contact administrator"
application/json:
example:
strict: false
value: !include examples/errors_500.sample
/voucher-number/start:
displayName: Voucher number sequence
description: Get or set the start value of the voucher number sequence
is: [validate]
get:
description: Get the current start value of the voucher number sequence
responses:
200:
body:
application/json:
type: sequenceNumber
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
example:
strict: false
value: !include examples/errors_500.sample