Se actualiza la descripción OpenAPI
[isfdt166-ansi-edi2-2024-server.git] / openapi / openapi.yaml
blob3d80f59539212e64310cf436057bf3fc58e34b8d
1 openapi: 3.0.0
2 info:
3   title: "Sistema de Reservas de Turnos Veterinarios"
4   description: |
5     Esta API permite gestionar un sistema de mascotas, veterinarios y turnos.
6   version: "0.1"
8 # ------------------------------------------------
9 # Definición de rutas
10 # ------------------------------------------------
12 paths:
15   # Rutas para el manejo de especies
16   # --------------------------------
18   /especie:
20     post:
21       summary: "Crear una especie"
22       description: "Se agrega una especie animal al sistema"
23       operationId: "especie-crear"
24       requestBody:
25         required: true
26         content:
27           application/json:
28             schema:
29               type: object
30               properties:
31                 name:
32                   type: string
33       responses:
34         '200':
35           description: "Especie creada exitosamente"
36           content:
37             application/json:
38               schema:
39                 type: object
40                 properties:
41                   id:
42                     type: integer
43                   name:
44                     type: string
45         '403':
46           description: "Especie existente"
47           content:
48             application/json:
49               schema:
50                 type: object
51                 properties:
52                   message:
53                     type: string
54                     example: "La especie que intenta agregar ya existe"
55         '422':
56           description: "Solicitud invalida"
57           content:
58             application/json:
59               schema:
60                 type: object
61                 properties:
62                   message:
63                     type: string
64                     example: "Nombre de especie inválido"
66     get:
67       summary: "Listar las especies"
68       description: "Se listan las especies cargadas en el sistema."
69       operationId: "especie-listar"
70       responses:
71         '200':
72           description: "Lista de especies disponibles en el sistema"
73           content:
74             application/json:
75               schema:
76                 type: array
77                 items:
78                   type: object
79                   properties:
80                     id:
81                       type: integer
82                     name:
83                       type: string
85   /especie/{id}:
87     parameters:
88       - name: id
89         in: path
90         required: true
91         schema:
92           type: integer
94     put:
95       summary: "Actualizar una especie"
96       description: "Se actualiza una especie del sistema"
97       operationId: "especie-editar"
98       requestBody:
99         required: true
100         content:
101           application/json:
102             schema:
103               type: object
104               properties:
105                 name:
106                   type: string
107       responses:
108         '200':
109           description: "Especie actualizada"
110           content:
111             application/json:
112               schema:
113                 type: object
114                 properties:
115                   id:
116                     type: integer
117                   name:
118                     type: string
119         '404':
120           description: "Especie no encontrada"
121           content:
122             application/json:
123               schema:
124                 type: object
125                 properties:
126                   message:
127                     type: string
128                     example: "ID invalido o inexistente"
130     delete:
131       summary: "Eliminar una especie"
132       description: "Se elimina una especie del sistema"
133       operationId: "especie-eliminar"
134       responses:
135         '200':
136           description: "Especie eliminada"
137           content:
138             application/json:
139               schema:
140                 type: object
141                 properties:
142                   id:
143                     type: integer
144                   name:
145                     type: string
146         '404':
147           description: "Especie no encontrada"
148           content:
149             application/json:
150               schema:
151                 type: object
152                 properties:
153                   message:
154                     type: string
155                     example: "ID invalido o inexistente"
158   # Rutas para el manejo de veterinarios
159   # ------------------------------------
161   /veterinario:
163     post:
164       summary: "Crear un veterinario"
165       description: "Se carga un veterinario en el sistema"
166       operationId: "veterinario-crear"
167       requestBody:
168         required: true
169         content:
170           application/json:
171             schema:
172               type: object
173               properties:
174                 name:
175                   type: string
176       responses:
177         '200':
178           description: "Veterinario creado exitosamente"
179           content:
180             application/json:
181               schema:
182                 type: object
183                 properties:
184                   id:
185                     type: integer
186                   name:
187                     type: string
189     get:
190       summary: "Listar los veterinarios"
191       description: "Permite listar los veterinarios cargados en el sistema."
192       operationId: "veterinario-listar"
193       responses:
194         '200':
195           description: "Lista de veterinarios disponibles en el sistema"
196           content:
197             application/json:
198               schema:
199                 type: array
200                 items:
201                   type: object
202                   properties:
203                     id:
204                       type: integer
205                     name:
206                       type: string
208   /veterinario/{id}:
210     parameters:
211       - name: id
212         in: path
213         required: true
214         schema:
215           type: integer
217     put:
218       summary: "Actualiza un veterinario"
219       description: "Se actualiza un veterinario del sistema"
220       operationId: "veterinario-editar"
221       requestBody:
222         required: true
223         content:
224           application/json:
225             schema:
226               type: object
227               properties:
228                 name:
229                   type: string
230       responses:
231         '200':
232           description: "Veterinario actualizado"
233           content:
234             application/json:
235               schema:
236                 type: object
237                 properties:
238                   id:
239                     type: integer
240                   name:
241                     type: string
243     delete:
244       summary: "Eliminar un veterinario"
245       description: "Se elimina un veterinario del sistema"
246       operationId: "veterinario-eliminar"
247       responses:
248         '200':
249           description: "Veterinario eliminado"
250           content:
251             application/json:
252               schema:
253                 type: object
254                 properties:
255                   id:
256                     type: integer
257                   name:
258                     type: string
261   # Rutas para el manejo de mascotas
262   # --------------------------------
264   /mascota:
266     post:
267       summary: "Crea una mascota"
268       description: "Se carga una mascota al sistema"
269       operationId: "mascota-crear"
270       requestBody:
271         required: true
272         content:
273           application/json:
274             schema:
275               type: object
276               properties:
277                 especie_id:
278                   type: integer
279                 name:
280                   type: string
281       responses:
282         '200':
283           description: "Mascota creada exitosamente"
284           content:
285             application/json:
286               schema:
287                 type: object
288                 properties:
289                   id:
290                     type: integer
291                   especie_id:
292                     type: integer
293                   name:
294                     type: string
296     get:
297       summary: "Lisgtar las mascotas"
298       description: "Se listan las mascotas cargadas en el sistema."
299       operationId: "mascota-listar"
300       responses:
301         '200':
302           description: "Lista de mascotas cargadas en el sistema"
303           content:
304             application/json:
305               schema:
306                 type: array
307                 items:
308                   type: object
309                   properties:
310                     id:
311                       type: integer
312                     especie_id:
313                       type: integer
314                     name:
315                       type: string
317   /mascota/{id}:
319     parameters:
320       - name: id
321         in: path
322         required: true
323         schema:
324           type: integer
326     put:
327       summary: "Actualizar una mascota"
328       description: "Se actualiza una mascota del sistema"
329       operationId: "mascota-editar"
330       requestBody:
331         required: true
332         content:
333           application/json:
334             schema:
335               type: object
336               properties:
337                 especie_id:
338                   type: integer
339                 name:
340                   type: string
341       responses:
342         '200':
343           description: "Mascota actualizada"
344           content:
345             application/json:
346               schema:
347                 type: object
348                 properties:
349                   id:
350                     type: integer
351                   especie_id:
352                     type: integer
353                   name:
354                     type: string
356     delete:
357       summary: "Eliminar una mascota"
358       description: "Se elimina una mascota del sistema"
359       operationId: "mascota-eliminar"
360       responses:
361         '200':
362           description: "Mascota eliminada"
363           content:
364             application/json:
365               schema:
366                 type: object
367                 properties:
368                   id:
369                     type: integer
370                   especie_id:
371                     type: integer
372                   name:
373                     type: string
376   # Rutas para el manejo de turnos
377   # ------------------------------
379   /disponibles:
380     get:
381       summary: "Turnos disponibles"
382       description: "Lista de turnos disponibles"
383       operationId: "turno-disponibles"
384       responses:
385         '200':
386           description: "Lista de turnos disponibles"
387           content:
388             application/json:
389               schema:
390                 type: array
391                 items:
392                   type: string
393                   format: date-time
394                   example: "1999-12-31T23:59:59Z"
396   /turno:
398     post:
399       summary: "Tomar un turno"
400       description: "Se toma un turno disponible"
401       operationId: "turno-crear"
402       requestBody:
403         required: true
404         content:
405           application/json:
406             schema:
407               type: object
408               properties:
409                 turno:
410                   type: string
411                   format: date-time
412                   example: "1999-12-31T23:59:59Z"
413                 mascota_id:
414                   type: integer
415       responses:
416         '200':
417           description: "Turno asignado exitosamente"
418           content:
419             application/json:
420               schema:
421                 type: object
422                 properties:
423                   turno:
424                     type: string
425                     format: date-time
426                     example: "1999-12-31T23:59:59Z"
427                   mascota_id:
428                     type: integer
430     get:
431       summary: "Listar los turnos"
432       description: "Se listan los turnos asignados"
433       operationId: "turno-listar"
434       responses:
435         '200':
436           description: "Lista de turnos asignados"
437           content:
438             application/json:
439               schema:
440                 type: array
441                 items:
442                   type: object
443                   properties:
444                     turno:
445                       type: string
446                       format: date-time
447                       example: "1999-12-31T23:59:59Z"
448                     mascota_id:
449                       type: integer
450                     veterinario_id:
451                       type: integer
453   /turno/{turno}/{mascota_id}:
455     parameters:
456       - name: turno
457         in: path
458         required: true
459         schema:
460           type: string
461           format: date-time
462           example: "1999-12-31T23:59:59Z"
463       - name: mascota_id
464         in: path
465         required: true
466         schema:
467           type: integer
469     delete:
470       summary: "Libera un turno"
471       description: "Se libera un turno tomado en el sistema"
472       operationId: "turno-eliminar"
473       responses:
474         '200':
475           description: "Turno liberado"
476           content:
477             application/json:
478               schema:
479                 type: object
480                 properties:
481                   turno:
482                     type: string
483                     format: date-time
484                     example: "1999-12-31T23:59:59Z"
485                   mascota_id:
486                     type: integer