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 Despachos API exposes five endpoints for managing dispatch records. All endpoints are served under the base path /api/v1/despachos. See the overview page for base URLs, the data model, and error handling.

POST /api/v1/despachos

Creates a new dispatch record. Returns 201 Created with the created object and a Location header pointing to the new resource.

Body parameters

fechaDespacho
string
Dispatch date in ISO-8601 format (YYYY-MM-DD).
patenteCamion
string
Truck license plate assigned to carry out the delivery.
intento
int
Delivery attempt number.
idCompra
Long
ID of the associated sale (Venta) that originated this dispatch.
direccionCompra
string
Delivery address, copied from the associated sale.
valorCompra
Long
Purchase value, copied from the associated sale.
despachado
boolean
default:"false"
Whether the delivery has been completed. Defaults to false.

Example

curl --request POST \
  --url http://localhost:3002/api/v1/despachos \
  --header 'Content-Type: application/json' \
  --data '{
    "fechaDespacho": "2024-03-16",
    "patenteCamion": "BCDF12",
    "intento": 1,
    "idCompra": 1,
    "direccionCompra": "Av. Providencia 1234, Santiago",
    "valorCompra": 45000,
    "despachado": false
  }'
Request body
{
  "fechaDespacho": "2024-03-16",
  "patenteCamion": "BCDF12",
  "intento": 1,
  "idCompra": 1,
  "direccionCompra": "Av. Providencia 1234, Santiago",
  "valorCompra": 45000,
  "despachado": false
}
Response body — 201 Created
{
  "idDespacho": 1,
  "fechaDespacho": "2024-03-16",
  "patenteCamion": "BCDF12",
  "intento": 1,
  "idCompra": 1,
  "direccionCompra": "Av. Providencia 1234, Santiago",
  "valorCompra": 45000,
  "despachado": false
}
StatusDescription
201 CreatedDispatch created successfully. Location header contains the URI of the new resource.
The POST endpoint does not enforce bean validation constraints. All fields are optional. Validation (@Valid) is only applied on PUT requests.

GET /api/v1/despachos

Returns a list of all dispatch records in the system.

Example

curl --request GET \
  --url http://localhost:3002/api/v1/despachos
Response body — 200 OK
[
  {
    "idDespacho": 1,
    "fechaDespacho": "2024-03-16",
    "patenteCamion": "BCDF12",
    "intento": 1,
    "idCompra": 1,
    "direccionCompra": "Av. Providencia 1234, Santiago",
    "valorCompra": 45000,
    "despachado": false
  },
  {
    "idDespacho": 2,
    "fechaDespacho": "2024-03-17",
    "patenteCamion": "XYZW99",
    "intento": 2,
    "idCompra": 2,
    "direccionCompra": "Calle Falsa 456, Valparaíso",
    "valorCompra": 28000,
    "despachado": true
  }
]
StatusDescription
200 OKReturns an array of all dispatches. Returns an empty array when no records exist.

GET /api/v1/despachos/

Returns the details of a single dispatch record by its ID.

Path parameters

idDespacho
Long
required
The unique identifier of the dispatch to retrieve.

Example

curl --request GET \
  --url http://localhost:3002/api/v1/despachos/1
Response body — 200 OK
{
  "idDespacho": 1,
  "fechaDespacho": "2024-03-16",
  "patenteCamion": "BCDF12",
  "intento": 1,
  "idCompra": 1,
  "direccionCompra": "Av. Providencia 1234, Santiago",
  "valorCompra": 45000,
  "despachado": false
}
StatusDescription
200 OKDispatch found and returned.
404 Not FoundNo dispatch exists with the given idDespacho.

PUT /api/v1/despachos/

Updates an existing dispatch record with new field values. All body fields are replaced with the provided values.

Path parameters

idDespacho
Long
required
The unique identifier of the dispatch to update.

Body parameters

fechaDespacho
string
Updated dispatch date in ISO-8601 format (YYYY-MM-DD).
patenteCamion
string
Updated truck license plate.
intento
int
Updated delivery attempt number.
idCompra
Long
Updated sale ID reference.
direccionCompra
string
Updated delivery address.
valorCompra
Long
Updated purchase value.
despachado
boolean
Updated delivery completion status.

Example

curl --request PUT \
  --url http://localhost:3002/api/v1/despachos/1 \
  --header 'Content-Type: application/json' \
  --data '{
    "fechaDespacho": "2024-03-16",
    "patenteCamion": "BCDF12",
    "intento": 2,
    "idCompra": 1,
    "direccionCompra": "Av. Providencia 1234, Santiago",
    "valorCompra": 45000,
    "despachado": true
  }'
Request body
{
  "fechaDespacho": "2024-03-16",
  "patenteCamion": "BCDF12",
  "intento": 2,
  "idCompra": 1,
  "direccionCompra": "Av. Providencia 1234, Santiago",
  "valorCompra": 45000,
  "despachado": true
}
Response body — 200 OK
{
  "idDespacho": 1,
  "fechaDespacho": "2024-03-16",
  "patenteCamion": "BCDF12",
  "intento": 2,
  "idCompra": 1,
  "direccionCompra": "Av. Providencia 1234, Santiago",
  "valorCompra": 45000,
  "despachado": true
}
StatusDescription
200 OKDispatch updated successfully. Returns the updated object.
400 Bad RequestValidation failed on one or more fields.
404 Not FoundNo dispatch exists with the given idDespacho.

DELETE /api/v1/despachos/

Permanently deletes a dispatch record. Returns no body on success.

Path parameters

idDespacho
Long
required
The unique identifier of the dispatch to delete.

Example

curl --request DELETE \
  --url http://localhost:3002/api/v1/despachos/1
StatusDescription
204 No ContentDispatch deleted successfully. No response body.
404 Not FoundNo dispatch exists with the given idDespacho.

Build docs developers (and LLMs) love