Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DevOpsDuoc/Evaluacion02_Devop_Innovatech/llms.txt

Use this file to discover all available pages before exploring further.

The Ventas API is a Spring Boot REST service that manages sales records for the Innovatech Chile pet store. It exposes five CRUD endpoints under the /api/v1/ventas path and requires no authentication.

Base URL

EnvironmentBase URL
Localhttp://localhost:3001/api/v1/ventas
AWShttp://{ec2-app-ip}:3001/api/v1/ventas

Request format

All requests and responses use JSON. Set the Content-Type header to application/json for requests that include a body.
Content-Type: application/json
CORS is open for all origins (@CrossOrigin(origins = "*")), so the API is accessible from any client without preflight restrictions.

Data model

Each sale (Venta) contains the following fields.
idVenta
Long
Auto-generated unique identifier for the sale. Assigned by the database on creation.
direccionCompra
String
required
Purchase and delivery address. Cannot be blank.
valorCompra
int
Purchase value (amount) in the store’s currency.
fechaCompra
LocalDate
required
Purchase date in ISO-8601 format (YYYY-MM-DD). Cannot be null.
despachoGenerado
Boolean
default:"false"
required
Indicates whether a dispatch record has been generated for this sale. Defaults to false.

Available endpoints

See the endpoints page for full request/response details.
MethodPathDescription
POST/api/v1/ventasCreate a new sale
GET/api/v1/ventasList all sales
GET/api/v1/ventas/{idVenta}Get a sale by ID
PUT/api/v1/ventas/{idVenta}Update an existing sale
DELETE/api/v1/ventas/{idVenta}Delete a sale

Error handling

status
HttpStatus
HTTP status enum value (e.g. NOT_FOUND, BAD_REQUEST).
message
String
Human-readable error message.
The API returns structured error responses for the following cases:
ConditionStatus codeDescription
Sale not found404 Not FoundThrown by VentaNotFoundException when the requested idVenta does not exist.
Validation failure400 Bad RequestReturned when required fields are missing or blank (e.g., direccionCompra, fechaCompra, despachoGenerado).
Example 404 response
{
  "status": "NOT_FOUND",
  "message": "Venta no encontrada"
}
Example 400 response
{
  "status": "BAD_REQUEST",
  "message": "La dirección es obligatoria"
}

Build docs developers (and LLMs) love