Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alvarezlautaro/BancoAlimentos/llms.txt

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

The Donantes API manages the companies and organisations that donate food to the bank. Each donor (donante) holds identifying and contact information: legal name (razón social), tax ID (CUIT), phone number, email, and address. Every endpoint requires a valid JWT in the Authorization header and enforces a specific Spring Security authority, so callers must have the appropriate role before the request is processed. Base URL: /api/donantes

Endpoints

GET /api/donantes

Returns the full list of registered donors. Required authority: EMPRESA_VER

Response

Returns an array of DonanteResponseDTO objects with HTTP 200 OK.
curl -s https://api.example.com/api/donantes \
  -H 'Authorization: Bearer <token>'
[
  {
    "razonSocial": "Alimentos del Sur S.A.",
    "cuit": "30712345678",
    "telefono": "01145678901",
    "email": "contacto@alimentosdelsur.com",
    "direccion": "Av. San Martín 1234, Buenos Aires"
  }
]

GET /api/donantes/{id}

Returns a single donor by its numeric ID. Required authority: EMPRESA_VER

Path parameters

id
Long
required
The unique numeric identifier of the donor.

Response

Returns a single DonanteResponseDTO object with HTTP 200 OK. Throws 404 if the donor is not found.
curl -s https://api.example.com/api/donantes/7 \
  -H 'Authorization: Bearer <token>'

POST /api/donantes

Creates a new donor record. Required authority: EMPRESA_CREAR

Request body

razonSocial
string
required
Legal business name of the donor company. Cannot be null.
cuit
string
required
Argentine tax identification number. Must be exactly 11 characters (digits only, no hyphens).
telefono
string
required
Contact phone number. Must be between 10 and 11 characters.
email
string
required
Contact email address. Must be a valid email format.
direccion
string
required
Physical address of the donor company. Cannot be null.

Response

Returns the created DonanteResponseDTO with HTTP 201 Created.
curl -s -X POST https://api.example.com/api/donantes \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "razonSocial": "Alimentos del Sur S.A.",
    "cuit": "30712345678",
    "telefono": "01145678901",
    "email": "contacto@alimentosdelsur.com",
    "direccion": "Av. San Martín 1234, Buenos Aires"
  }'
{
  "razonSocial": "Alimentos del Sur S.A.",
  "cuit": "30712345678",
  "telefono": "01145678901",
  "email": "contacto@alimentosdelsur.com",
  "direccion": "Av. San Martín 1234, Buenos Aires"
}

PUT /api/donantes/{id}

Fully replaces an existing donor record. All fields must be provided. Required authority: EMPRESA_ACTUALIZAR

Path parameters

id
Long
required
The unique numeric identifier of the donor to update.

Request body

Same fields as POST /api/donantes — all fields are required.

Response

Returns the updated DonanteResponseDTO with HTTP 200 OK.
curl -s -X PUT https://api.example.com/api/donantes/7 \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "razonSocial": "Alimentos del Sur S.A.",
    "cuit": "30712345678",
    "telefono": "01145679999",
    "email": "nuevo@alimentosdelsur.com",
    "direccion": "Av. San Martín 1234, Buenos Aires"
  }'

DELETE /api/donantes/{id}

Permanently deletes a donor record by ID. Required authority: EMPRESA_ELIMINAR

Path parameters

id
Long
required
The unique numeric identifier of the donor to delete.

Response

Returns HTTP 200 OK with the plain-text body "Donante eliminado".
curl -s -X DELETE https://api.example.com/api/donantes/7 \
  -H 'Authorization: Bearer <token>'

GET /api/donantes/{id}/historial

Returns the full audit history for a given donor — all past versions of the record as stored by the auditing mechanism. Required authority: AUDITORIA_DONACION_VER

Path parameters

id
Long
required
The unique numeric identifier of the donor whose history is requested.

Response

Returns an array of Donante entity snapshots representing the change history with HTTP 200 OK.
curl -s https://api.example.com/api/donantes/7/historial \
  -H 'Authorization: Bearer <token>'

Schemas

Donante request schema

Fields sent when creating or updating a donor.
razonSocial
string
Legal business name of the donor. Required; cannot be null.
cuit
string
Tax ID (CUIT). Must be exactly 11 characters.
telefono
string
Contact phone number. Must be 10–11 characters.
email
string
Contact email address. Must be a valid email format.
direccion
string
Physical address. Required; cannot be null.

Donante response schema

Fields returned in all donor read operations.
razonSocial
string
Legal business name of the donor.
cuit
string
Tax ID (CUIT) of the donor.
telefono
string
Contact phone number.
email
string
Contact email address.
direccion
string
Physical address.

Error responses

HTTP StatusCondition
400 Bad RequestValidation failure on request body fields (e.g. CUIT length, null required fields).
401 UnauthorizedMissing or invalid JWT.
403 ForbiddenValid JWT but the user lacks the required authority.
404 Not FoundNo donor found for the supplied id.

Build docs developers (and LLMs) love