-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinvoice.raml
More file actions
232 lines (222 loc) · 9.83 KB
/
Copy pathinvoice.raml
File metadata and controls
232 lines (222 loc) · 9.83 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
#%RAML 1.0
title: Invoice
version: v5.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost
documentation:
- title: Invoice API
content: This documents the API calls that can be made to manage invoices
types:
invoice: !include acq-models/mod-invoice-storage/schemas/invoice.json
invoiceCollection: !include acq-models/mod-invoice-storage/schemas/invoice_collection.json
invoiceDocument: !include acq-models/mod-invoice-storage/schemas/document.json
documentCollection: !include acq-models/mod-invoice-storage/schemas/document_collection.json
fiscalYearCollection: !include acq-models/mod-finance/schemas/fiscal_year_collection.json
invoiceLine: !include acq-models/mod-invoice-storage/schemas/invoice_line.json
invoiceLineCollection: !include acq-models/mod-invoice-storage/schemas/invoice_line_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}$
validate_fund_distributions_request: !include acq-models/mod-invoice/schemas/validate_fund_distributions_request.json
traits:
validate: !include raml-util/traits/validation.raml
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
resourceTypes:
collection: !include raml-util/rtypes/collection-with-json-response.raml
collection-item: !include raml-util/rtypes/item-collection-with-json-response.raml
get-delete: !include raml-util/rtypes/get-delete-with-json-response.raml
get-only: !include raml-util/rtypes/get-only-with-json-response.raml
/invoice:
/invoices:
displayName: Invoice
description: Manage Invoices
type:
collection:
schemaCollection: invoiceCollection
schemaItem: invoice
exampleCollection: !include acq-models/mod-invoice-storage/examples/invoice_collection.sample
exampleItem: !include acq-models/mod-invoice-storage/examples/invoice.sample
post:
description: Post invoice. Only in case an acquisition unit has to be assigned to the invoice, it is required that user should have extra permission invoices.acquisitions-units-assignments.create.execute to create an Invoice.
is: [validate]
get:
is: [ pageable, searchable: {description: "using CQL (indexes for invoice)", example: "invoiceLineStatus==\"Open\""}, validate ]
/{id}:
uriParameters:
id:
description: The UUID of an invoice
type: UUID
displayName: Invoice
description: Get, Delete or Update a specific invoice
type:
collection-item:
schema: invoice
exampleItem: !include acq-models/mod-invoice-storage/examples/invoice.sample
get:
description: Return an invoice with given {id}
put:
description: Update invoice. Only in case an acquisition units list has to be changed, it is required that user should have extra permission invoices.acquisitions-units-assignments.manage.execute to update an Invoice.
queryParameters:
poLinePaymentStatus:
description: how to update the payment status of po lines when approving or cancelling the invoice;
only applies to lines with releaseEncumbrance=true linked to po lines of one-time open orders;
required when approving or cancelling an invoice in a past fiscal year containing lines with releaseEncumbrance=true linked to po lines of one-time open orders;
invoice lines with releaseEncumbrance=false have their po line statuses changed from Awaiting Payment to Partially Paid
type: string
pattern: "No Change|Awaiting Payment|Partially Paid|Fully Paid|Cancelled"
required: false
is: [validate]
delete:
description: Delete an invoice with given {id}
/documents:
displayName: Document
description: Manage documents associated with invoice
type:
get-only:
schema: documentCollection
exampleCollection: !include acq-models/mod-invoice-storage/examples/document_collection.sample
get:
description: Get list of documents
is: [
pageable,
searchable: {description: "with valid searchable fields: for example metadata.createdDate", example: "metadata.createdDate > '2018-07-19T00:00:00.000+0000'"},
]
post:
description: Post document attachment/link;
is: [validate]
body:
application/octet-stream:
example:
strict: false
value: !include acq-models/mod-invoice-storage/examples/document.sample
responses:
201:
description: "Returns a newly created item, with server-controlled fields like 'id' populated"
headers:
Location:
description: URI to the created Invoice Document item
body:
application/json:
example: !include acq-models/mod-invoice-storage/examples/document.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:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: |
"unable to add Invoice Document -- malformed JSON at 13:3"
401:
description: "Not authorized to perform requested action"
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: "unable to create Invoice Document -- unauthorized"
413:
description: "Invoice Document too large "
body:
application/json:
example:
strict: false
value: !include raml-util/examples/errors.sample
text/plain:
example: "unable to create Invoice Document -- unauthorized"
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"
/{documentId}:
description: Get and Delete a specific document attachments/links. Update operation is not allowed
uriParameters:
documentId:
description: The UUID of a document
type: UUID
type:
get-delete:
schema: invoiceDocument
exampleItem: !include acq-models/mod-invoice-storage/examples/document.sample
/fiscal-years:
displayName: Fiscal Years
description: Past and present fiscal years associated with the invoice
type:
get-only:
schema: fiscalYearCollection
exampleCollection: !include acq-models/mod-finance/examples/fiscal_year_collection.sample
get:
description: Get a list of fiscal years to approve or pay the invoice
/invoice-lines:
displayName: Invoice Lines
description: Manage Invoice lines
type:
collection:
schemaCollection: invoiceLineCollection
schemaItem: invoiceLine
exampleCollection: !include acq-models/mod-invoice-storage/examples/invoice_line_collection.sample
exampleItem: !include acq-models/mod-invoice-storage/examples/invoice_line.sample
is: [validate]
get:
is: [ pageable, searchable: {description: "using CQL (indexes for invoice lines)", example: "status==\"Open\""}, validate ]
post:
description: Post an invoice lines to corresponding invoice
/{id}:
displayName: Invoice Line
description: Manage invoice line by id
uriParameters:
id:
description: The UUID of a invoice line
type: UUID
type:
collection-item:
exampleItem: !include acq-models/mod-invoice-storage/examples/invoice_line.sample
schema: invoiceLine
is: [validate]
get:
description: Return an invoice line with given {id}
put:
description: Update an invoice line with given {id}
queryParameters:
skipPoNumbers:
displayName: Skip updating PO numbers on the Invoice to avoid potential deadlocks
type: boolean
example: true
required: false
default: false
delete:
description: Delete an invoice line with given {id}
/fund-distributions/validate:
displayName: Validate fund distributions
put:
description: Validate is total amount equals to sum of all fund distributions
body:
application/json:
type: validate_fund_distributions_request
example:
strict: false
value: !include acq-models/mod-invoice/examples/validate_fund_distributions_request.sample
responses:
204:
description: "Validation passes"
422:
description: "Validation failed, error with description and codes provided"
/invoice-number:
displayName: Invoice Number
description: Manage Invoice Number
type:
get-only:
schema: invoiceCollection
exampleCollection: !include acq-models/mod-invoice-storage/examples/invoice_collection.sample
get:
description: Get system generated Invoice Number
is: [validate]