The Sales module provides two complementary views: VentasMain atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_front/llms.txt
Use this file to discover all available pages before exploring further.
/ventas shows a paginated history of every recorded transaction, and PuntoDeVenta at /ventas/pos is the live cashier terminal where products are scanned, a payment method is chosen, and sales are confirmed. Both views share real-time product data pushed by a Socket.IO dataChanged event so stock levels are always current.
VentaDTO Interfaces
Sale States
estado_venta | Description |
|---|---|
COMPLETADA | Default state after a successful checkout. Stock has been decremented. |
ANULADA | Sale was voided after the fact. Stock is not automatically restored — this requires a manual purchase adjustment. |
EDITADA | Payment method or session reference was corrected after the fact, recorded via PATCH /ventas/:id. A motivo_edicion is required. |
POS Workflow
Open an active shift
Before visiting
/ventas/pos, ensure a cash-register session is open at /cajas. The CajaContext resolves sesionActiva on app load. The terminal blocks immediately if no session exists.Search or scan a product
Type a product name or barcode into the search field at the top of the left panel. The list filters in real time matching both
nombre and codigo_barras. Clicking any row calls addToCart().Validate stock and add to cart
addToCart() checks producto.stock_actual before adding:- If
stock_actual <= 0, a SweetAlert2 error dialog blocks the addition (“Producto Agotado”). - If
stock_actual - newQuantity <= stock_minimo, a SweetAlert2 warning toast fires from the top-right corner (“¡Stock Mínimo!”) — the item is still added. - If
quantity > stock_actual, a SweetAlert2 error prevents exceeding available stock.
Adjust quantities in the cart
Use the
− / + controls or type directly into the quantity input on each cart row. Every change re-runs the stock-check logic and displays a toast when the minimum threshold is reached.Select a payment method
Choose from the dropdown at the bottom of the cart panel:
| Value | Label |
|---|---|
EFECTIVO | Efectivo (cash) |
QR | Pago QR (scan from mobile wallet) |
TRANSFERENCIA | Transferencia Bancaria |
Confirm the sale
Click “Cobrar Bs. X.XX”. The frontend sends
POST /ventas with the CrearVentaRequest payload. On HTTP 200 or 201:- The cart is cleared.
- Products are re-fetched to reflect the updated stock.
- A success modal opens showing the ticket summary (items, method, session ID, and total).
Payment Methods
- EFECTIVO
- QR
- TRANSFERENCIA
Cash payment. The full amount is registered against the current caja session balance as an INGRESO. No external confirmation is needed — the cashier counts physical cash.
Real-Time Product Sync
The POS subscribes to the Socket.IO server viauseSocket() (provided by SocketContext). Whenever the backend emits dataChanged with entity === "producto", "venta", or "product", the terminal calls fetchProductos() immediately — keeping displayed stock counts accurate even when another terminal processes a concurrent sale.
Sales REST Endpoints
URL Routes
| Page | Path |
|---|---|
| Sales history | /ventas |
| POS terminal | /ventas/pos |