Despachos (also referred to as Salidas) are the outbound movement records that capture the delivery of warehouse materials to employees. Accessible atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt
Use this file to discover all available pages before exploring further.
/salidas, each Despacho documents who received the materials, why they were requested, and which specific stock items were issued in what quantities. Once created, a dispatch can be exported as a formal signed PDF acta — a physical document that serves as the official record of the handover.
Data Model
TheSalida schema represents a single dispatch record.
Auto-generated primary key for the dispatch.
Human-readable dispatch number (e.g.
SAL-001). Must be unique.ISO-8601 date string for when the dispatch occurred (e.g.
2025-01-20).Indicates whether available stock was confirmed before issuing the dispatch. Set to
true when a warehouse operator has verified that the requested quantities are in stock.Free-text explanation of why the materials are being dispatched (e.g.
"Mantenimiento mensual"). Optional.Foreign key referencing the employee (
empleados) who is receiving the dispatched materials.Foreign key referencing the finance manager responsible for approving or reviewing the dispatch. Optional; set to
null when no finance review is required.Foreign key referencing the president for high-level approval. Optional; set to
null when presidential sign-off is not required.Additional free-text notes about the dispatch. Optional.
Workflow
A Despacho moves through a defined lifecycle from initial creation to final signed documentation.Create the Dispatch
A warehouse operator opens the Nueva Salida de Almacén dialog at
/salidas, enters the dispatch number, date, and selects the employee who will receive the materials (fk_id_empleado_recibe). A reason (motivo_solicitud) may be provided to document the purpose of the request.Validate Stock Availability
Before adding material lines, the operator checks the Existencia Validada checkbox to confirm that the requested items are physically available in the warehouse. Setting
existencia_validada to true signals that a stock check has been performed and the dispatch is cleared to proceed.Add Material Lines
Materials are selected from the live existencias list, which shows each item alongside its current available quantity (
cantidad_actual). The operator enters the Cantidad for each item and clicks Agregar to add it to the dispatch table. Each stock entry (existencia) can only appear once per dispatch. Both cantidad_solicitada and cantidad_entregada are recorded per line.Link Approvers (Optional)
If the dispatch requires formal sign-off,
fk_id_gerente_finanzas and fk_id_presidente can be linked to the record to associate the relevant approvers before or after creation.Saving a Despacho automatically decreases the warehouse stock (
existencias) quantities for every material line in the dispatch. No separate stock adjustment step is needed.PDF Generation
Each dispatch can be exported as a formatted PDF acta that serves as the official handover document. The download is triggered via thedownloadSalidaPdf function in the salidas API client.
How it works:
- Calls
GET /salidas/:id/pdfwithresponseType: 'blob'to receive the binary PDF data. - Creates a temporary in-memory object URL from the response blob.
- Programmatically clicks a hidden
<a>element to trigger the browser’s native file download. - The file is saved as
acta-salida-{id}.pdf(e.g.acta-salida-42.pdf). - Cleans up by removing the temporary DOM element and revoking the object URL.
FileDown icon) that calls downloadSalidaPdf directly with the row’s id_salida.
API Operations
List All Dispatches
Returns all Salida records in the system.Create a Dispatch
Creates a new Despacho and its material detail lines in a single request. The backend decrements warehouse stock for all materials indetalles.
Unique dispatch number (e.g.
SAL-001).Dispatch date in
YYYY-MM-DD format.Whether stock availability was confirmed prior to dispatch. Defaults to
false.Reason for the material request. Optional.
ID of the employee receiving the materials.
ID of the finance manager approver. Optional.
ID of the presidential approver. Optional.
Additional notes. Optional; pass
null to omit.Array of stock-line items to dispatch. Each element requires
fk_id_existencia (number — the existencia record ID, not fk_id_material), cantidad_solicitada (number > 0), and cantidad_entregada (number > 0). Minimum one item required.Download PDF Acta
Returns the binary PDF document for the specified dispatch. The client must setresponseType: 'blob' to handle the binary response correctly.
The
id_salida of the dispatch whose acta should be downloaded.downloadSalidaPdf(id) function handles blob-to-file conversion automatically and saves the file as acta-salida-{id}.pdf.