{"openapi":"3.0.0","info":{"title":"API del Sistema de Ventas","version":"1.0.0","description":"API RESTful para la gestión del sistema de ventas.  Incluye operaciones CRUD para Clientes, Mesas, Usuarios, Ventas, Detalles, Cargos, Categorías y Productos.\n"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/independent-340/Restaurante/1.0.0"},{"url":"http://localhost:8080/api/v1","description":"Servidor de Desarrollo local"}],"paths":{"/clientes":{"get":{"summary":"Obtener todos los clientes","operationId":"getClientes","responses":{"200":{"description":"Lista de clientes obtenida exitosamente","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Cliente"}}}}}}},"post":{"summary":"Registrar un nuevo cliente (registrarCliente)","operationId":"createCliente","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClienteInput"}}}},"responses":{"201":{"description":"Cliente creado exitosamente"}}}},"/clientes/{idCliente}":{"parameters":[{"name":"idCliente","in":"path","required":true,"schema":{"type":"integer"}}],"get":{"summary":"Obtener un cliente por su ID","operationId":"getClienteById","responses":{"200":{"description":"Cliente encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cliente"}}}},"404":{"description":"Cliente no encontrado"}}},"put":{"summary":"Actualizar todos los datos de un cliente (actualizarDatos)","operationId":"updateCliente","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClienteInput"}}}},"responses":{"200":{"description":"Cliente actualizado exitosamente"}}},"patch":{"summary":"Actualizar parcialmente un cliente","operationId":"patchCliente","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClienteInput"}}}},"responses":{"200":{"description":"Cliente actualizado parcialmente"}}},"delete":{"summary":"Eliminar un cliente","operationId":"deleteCliente","responses":{"204":{"description":"Cliente eliminado exitosamente"}}}},"/productos":{"get":{"summary":"Listar todos los productos","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Producto"}}}}}}},"post":{"summary":"Crear un nuevo producto (crearProducto)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductoInput"}}}},"responses":{"201":{"description":"Creado"}}}},"/productos/{idProducto}":{"parameters":[{"name":"idProducto","in":"path","required":true,"schema":{"type":"integer"}}],"get":{"summary":"Obtener producto","responses":{"200":{"description":"OK"}}},"put":{"summary":"Reemplazar producto (modificarProducto)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductoInput"}}}},"responses":{"200":{"description":"Actualizado"}}},"patch":{"summary":"Actualizar precio o datos parciales (actualizarPrecio)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductoInput"}}}},"responses":{"200":{"description":"Actualizado"}}},"delete":{"summary":"Eliminar producto (eliminarProducto)","responses":{"204":{"description":"Eliminado"}}}},"/ventas":{"get":{"summary":"Obtener todas las ventas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Venta"}}}}}}},"post":{"summary":"Crear una nueva venta (crearVenta)","description":"Este endpoint debería manejar la lógica de transacción junto con DetalleVenta.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VentaInput"}}}},"responses":{"201":{"description":"Venta creada"}}}},"/ventas/{idVenta}":{"parameters":[{"name":"idVenta","in":"path","required":true,"schema":{"type":"integer"}}],"get":{"summary":"Obtener venta por ID (generarComprobante)","responses":{"200":{"description":"OK"}}},"put":{"summary":"Modificar datos de la venta","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VentaInput"}}}},"responses":{"200":{"description":"OK"}}},"patch":{"summary":"Finalizar o cancelar venta (finalizarVenta / cancelarVenta)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"estado":{"type":"string","example":"FINALIZADA"}}}}}},"responses":{"200":{"description":"Estado de venta actualizado"}}},"delete":{"summary":"Eliminar registro de venta","responses":{"204":{"description":"Eliminado"}}}}},"components":{"schemas":{"Cliente":{"type":"object","properties":{"idCliente":{"type":"integer"},"fechaRegistro":{"type":"string","format":"date-time"},"nomCli":{"type":"string","maxLength":50}}},"ClienteInput":{"type":"object","properties":{"fechaRegistro":{"type":"string","format":"date-time"},"nomCli":{"type":"string","maxLength":50}}},"Mesa":{"type":"object","properties":{"idMesa":{"type":"integer"},"nroMesa":{"type":"integer"},"ubicacion":{"type":"string","maxLength":40},"descripcion":{"type":"string","maxLength":40}}},"Usuario":{"type":"object","properties":{"idEmpleado":{"type":"integer"},"fechaIngreso":{"type":"string","format":"date-time"},"telefono":{"type":"integer"},"DNI":{"type":"integer"},"fechaNac":{"type":"string","format":"date-time"},"nomEmp":{"type":"string","maxLength":50},"apeEmp":{"type":"string","maxLength":50},"area":{"type":"string","maxLength":20}}},"Cargo":{"type":"object","properties":{"idCargo":{"type":"integer"},"idEmpleado":{"type":"integer","description":"FK hacia Usuario"},"nomCargo":{"type":"string","maxLength":40}}},"Categoria":{"type":"object","properties":{"idCategoria":{"type":"integer"},"nomCat":{"type":"string","maxLength":50}}},"Producto":{"type":"object","properties":{"idProducto":{"type":"integer"},"idCategoria":{"type":"integer","description":"FK hacia Categoria"},"nomProd":{"type":"string","maxLength":40},"precio":{"type":"number","format":"double"},"descripcion":{"type":"string","maxLength":50}}},"ProductoInput":{"type":"object","properties":{"idCategoria":{"type":"integer"},"nomProd":{"type":"string"},"precio":{"type":"number"},"descripcion":{"type":"string"}}},"Venta":{"type":"object","properties":{"idVenta":{"type":"integer"},"idMesa":{"type":"integer"},"idCliente":{"type":"integer"},"idEmpleado":{"type":"integer"},"fechaEmi":{"type":"string","format":"date-time"},"nroPedido":{"type":"integer","format":"int32"}}},"VentaInput":{"type":"object","properties":{"idMesa":{"type":"integer"},"idCliente":{"type":"integer"},"idEmpleado":{"type":"integer"},"fechaEmi":{"type":"string","format":"date-time"},"nroPedido":{"type":"integer"}}},"DetalleVenta":{"type":"object","properties":{"idDetalle":{"type":"integer"},"idVenta":{"type":"integer"},"idProducto":{"type":"integer"},"cantidad":{"type":"integer","format":"int32"},"importe":{"type":"integer","format":"int32"}}}}}}