Bug 29620: Move the OpenAPI spec to YAML format
[koha.git] / api / v1 / swagger / paths / return_claims.yaml
1 ---
2 /return_claims:
3   post:
4     x-mojo-to: ReturnClaims#claim_returned
5     operationId: claimReturned
6     summary: Add a return claim
7     tags:
8       - return_claims
9     parameters:
10       - name: body
11         in: body
12         description: A JSON object containing fields to modify
13         required: true
14         schema:
15           type: object
16           properties:
17             item_id:
18               description: Internal item id to claim as returned
19               type: integer
20             notes:
21               description: Notes about this return claim
22               type: string
23             created_by:
24               description: User id for the librarian submitting this claim
25               type: string
26             charge_lost_fee:
27               description: Charge a lost fee if true and Koha is set to allow a choice.
28                 Ignored otherwise.
29               type: boolean
30           additionalProperties: false
31     produces:
32       - application/json
33     responses:
34       "201":
35         description: Created claim
36         schema:
37           $ref: ../definitions.yaml#/return_claim
38       "400":
39         description: Bad request
40         schema:
41           $ref: ../definitions.yaml#/error
42       "401":
43         description: Authentication required
44         schema:
45           $ref: ../definitions.yaml#/error
46       "403":
47         description: Access forbidden
48         schema:
49           $ref: ../definitions.yaml#/error
50       "404":
51         description: Checkout not found
52         schema:
53           $ref: ../definitions.yaml#/error
54       "409":
55         description: Conflict creating the resource
56         schema:
57           $ref: ../definitions.yaml#/error
58       "500":
59         description: Internal server error
60         schema:
61           $ref: ../definitions.yaml#/error
62       "503":
63         description: Under maintenance
64         schema:
65           $ref: ../definitions.yaml#/error
66     x-koha-authorization:
67       permissions:
68         circulate: circulate_remaining_permissions
69 "/return_claims/{claim_id}/notes":
70   put:
71     x-mojo-to: ReturnClaims#update_notes
72     operationId: updateClaimNotes
73     summary: Update notes
74     tags:
75       - return_claims
76     parameters:
77       - name: claim_id
78         in: path
79         required: true
80         description: Unique identifier for the claim whose notes are to be updated
81         type: integer
82       - name: body
83         in: body
84         description: A JSON object containing fields to modify
85         required: true
86         schema:
87           type: object
88           properties:
89             notes:
90               description: Notes about this return claim
91               type: string
92             updated_by:
93               description: Interal identifier for the librarian updating the claim notes
94               type: string
95           additionalProperties: false
96     produces:
97       - application/json
98     responses:
99       "200":
100         description: Claim notes updated
101         schema:
102           $ref: ../definitions.yaml#/return_claim
103       "400":
104         description: Bad request
105         schema:
106           $ref: ../definitions.yaml#/error
107       "401":
108         description: Authentication required
109         schema:
110           $ref: ../definitions.yaml#/error
111       "403":
112         description: Access forbidden
113         schema:
114           $ref: ../definitions.yaml#/error
115       "404":
116         description: Claim not found
117         schema:
118           $ref: ../definitions.yaml#/error
119       "500":
120         description: Internal server error
121         schema:
122           $ref: ../definitions.yaml#/error
123       "503":
124         description: Under maintenance
125         schema:
126           $ref: ../definitions.yaml#/error
127     x-koha-authorization:
128       permissions:
129         circulate: circulate_remaining_permissions
130 "/return_claims/{claim_id}":
131   delete:
132     x-mojo-to: ReturnClaims#delete_claim
133     operationId: deletedClaim
134     summary: Delete claim
135     tags:
136       - return_claims
137     parameters:
138       - name: claim_id
139         in: path
140         required: true
141         description: Unique identifier for the claim to be deleted
142         type: integer
143     produces:
144       - application/json
145     responses:
146       "204":
147         description: Claim deleted
148         schema:
149           $ref: ../definitions.yaml#/return_claim
150       "400":
151         description: Bad request
152         schema:
153           $ref: ../definitions.yaml#/error
154       "401":
155         description: Authentication required
156         schema:
157           $ref: ../definitions.yaml#/error
158       "403":
159         description: Access forbidden
160         schema:
161           $ref: ../definitions.yaml#/error
162       "404":
163         description: Claim not found
164         schema:
165           $ref: ../definitions.yaml#/error
166       "500":
167         description: Internal server error
168         schema:
169           $ref: ../definitions.yaml#/error
170       "503":
171         description: Under maintenance
172         schema:
173           $ref: ../definitions.yaml#/error
174     x-koha-authorization:
175       permissions:
176         circulate: circulate_remaining_permissions
177 "/return_claims/{claim_id}/resolve":
178   put:
179     x-mojo-to: ReturnClaims#resolve_claim
180     operationId: updateClaimResolve
181     summary: Resolve claim
182     tags:
183       - return_claims
184     parameters:
185       - name: claim_id
186         in: path
187         required: true
188         description: Unique identifier for the claim to be resolved
189         type: integer
190       - name: body
191         in: body
192         description: A JSON object containing fields to modify
193         required: true
194         schema:
195           type: object
196           properties:
197             resolution:
198               description: The RETURN_CLAIM_RESOLUTION code to be used to resolve the calim
199               type: string
200             resolved_by:
201               description: User id for the librarian resolving the claim
202               type: string
203             new_lost_status:
204               description: New lost status to set to the item
205               type: string
206           additionalProperties: false
207     produces:
208       - application/json
209     responses:
210       "200":
211         description: Claim resolved
212         schema:
213           $ref: ../definitions.yaml#/return_claim
214       "400":
215         description: Bad request
216         schema:
217           $ref: ../definitions.yaml#/error
218       "401":
219         description: Authentication required
220         schema:
221           $ref: ../definitions.yaml#/error
222       "403":
223         description: Access forbidden
224         schema:
225           $ref: ../definitions.yaml#/error
226       "404":
227         description: Claim not found
228         schema:
229           $ref: ../definitions.yaml#/error
230       "500":
231         description: Internal server error
232         schema:
233           $ref: ../definitions.yaml#/error
234       "503":
235         description: Under maintenance
236         schema:
237           $ref: ../definitions.yaml#/error
238     x-koha-authorization:
239       permissions:
240         circulate: circulate_remaining_permissions