Skip to main content
All endpoints in this group return responses wrapped in ApiResponse<T>. See the API Overview for the envelope schema. A discrepancy (DiscrepanciaRecepcion) is created when the total received during a CEDIS reception does not match the total expected. It captures the truck, department, and the numeric difference.

GET /api/discrepancias

Returns all discrepancy records across all receptions.

Example request

curl -X GET http://localhost:8080/api/discrepancias

Example response

{
  "total": 2,
  "fecha": "2026-04-07T14:00:00.000000",
  "data": [
    {
      "idDiscrepancia": 1,
      "numeroCamion": "CAM-001",
      "departamento": "LACTEOS",
      "totalEsperado": 120,
      "totalRecibido": 115,
      "totalFaltante": 5,
      "fechaRegistro": "2026-04-07"
    },
    {
      "idDiscrepancia": 2,
      "numeroCamion": "CAM-003",
      "departamento": "FRUTAS",
      "totalEsperado": 80,
      "totalRecibido": 78,
      "totalFaltante": 2,
      "fechaRegistro": "2026-04-06"
    }
  ]
}

POST /api/discrepancias

Registers a new discrepancy record.
Discrepancies are typically created automatically by the CEDIS reception service when totalRecibido differs from totalEsperado. Use this endpoint to create manual records if needed.

Request body

numeroCamion
string
required
Truck number associated with the reception where the discrepancy occurred.
departamento
string
required
Name of the department where the discrepancy was detected.
totalEsperado
number
required
Total quantity that was expected per the order or invoice.
totalRecibido
number
required
Total quantity that was actually received.
totalFaltante
number
required
Difference between totalEsperado and totalRecibido. Typically totalEsperado - totalRecibido.
fechaRegistro
string
Date of the discrepancy in yyyy-MM-dd format. If omitted, the server may leave this field null.

Example request

curl -X POST http://localhost:8080/api/discrepancias \
  -H "Content-Type: application/json" \
  -d '{
    "numeroCamion": "CAM-005",
    "departamento": "CARNES",
    "totalEsperado": 50,
    "totalRecibido": 45,
    "totalFaltante": 5,
    "fechaRegistro": "2026-04-07"
  }'

Example response

{
  "total": 1,
  "fecha": "2026-04-07T14:20:00.000000",
  "data": {
    "idDiscrepancia": 3,
    "numeroCamion": "CAM-005",
    "departamento": "CARNES",
    "totalEsperado": 50,
    "totalRecibido": 45,
    "totalFaltante": 5,
    "fechaRegistro": "2026-04-07"
  }
}

DiscrepanciaRecepcion object schema

idDiscrepancia
number
Auto-generated primary key.
numeroCamion
string
Truck number where the discrepancy was detected.
departamento
string
Department name where the discrepancy occurred.
totalEsperado
number
Total quantity expected per the order or invoice.
totalRecibido
number
Total quantity actually received.
totalFaltante
number
The shortfall: totalEsperado - totalRecibido.
fechaRegistro
string
Date the discrepancy was recorded, in yyyy-MM-dd format.