This page is a comprehensive reference for every TypeScript interface used across the Kantuta POS API. All models are ready to copy into yourDocumentation 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.
src/types/api.d.ts file. The interfaces are grouped by domain to make cross-module relationships easier to trace.
Every entity model in Kantuta POS extends
BaseEntityAudit. This base interface provides soft-delete support (estado), full audit trails (id_user_create, id_user_update), and automatic timestamps (created_at, updated_at). You will never receive a database record that lacks these five fields.Base Types
BaseEntityAudit
BaseEntityAudit
The root audit interface inherited by every entity in the system. The
estado field drives soft deletes — when false, the record is considered inactive and is filtered out of standard list queries.Role
Role
Represents a system role assigned to a
Usuario. The nombre field controls access permissions throughout the POS. Current supported values are "admin" and "user", though the backend accepts any string for custom roles.Persona
Persona
Stores the personal identity data for every individual in the system. Each
Usuario is linked to exactly one Persona. The fecha_nacimiento field must always be in YYYY-MM-DD format.Usuario
Usuario
The system account model. Each user holds credentials (
email/password — password is never returned in responses), a display name, a linked Persona, and an assigned Role.Inventory
Categoria
Categoria
Groups products into logical categories. The
productos relation is optional and is only populated when fetching a category with its associated items.Producto
Producto
Represents a sellable item in the store’s inventory. The
stock_actual decreases on each sale and increases on each purchase. When stock_actual falls below stock_minimo, the UI should surface a low-stock alert.Operations
Caja
Caja
A physical point-of-sale terminal. The
especialidad field restricts which transaction types the register can process. A SOLO_VENTAS register cannot record agent operations; a SOLO_AGENTES register cannot record product sales. MIXTA has no restrictions.SesionCaja
SesionCaja
Represents a single cashier shift. Opened with a declared
monto_inicial and closed with the cashier’s physical count (monto_final_real). On close, the backend computes monto_final_teorico and diferencia for reconciliation. A session must be "ABIERTA" before any sales, agent transactions, or movements can be recorded.MovimientoCaja
MovimientoCaja
Records any ad-hoc cash flow within a session that is not a sale, purchase, or agent transaction. Common examples include adding change float (
INGRESO) or paying a utility bill (EGRESO). All movements are included in the theoretical balance calculation at session close.Venta and DetalleVenta
Venta and DetalleVenta
Venta is the sale header; DetalleVenta contains line items. Creating a sale automatically decrements stock_actual for each product in the detalles array and computes all subtotal and total values server-side.Compra and DetalleCompra
Compra and DetalleCompra
Compra records stock restocking from a supplier. Setting pagado_con_caja: true on creation automatically registers an EGRESO movement against the linked session. Stock levels and costo_compra for each product are updated automatically.Agents & Recargas
TransaccionAgente
TransaccionAgente
Records a single banking agent operation — deposit, withdrawal, or QR transfer. The
banco field is free text. Both client-facing and bank-side commissions are tracked. All transactions are linked to an active session and support soft delete for voiding.OperadoraSaldo
OperadoraSaldo
Tracks the available credit balance for each mobile operator (Tigo, Entel, Viva). Checked before processing a client top-up to confirm there is sufficient balance in the pool to fulfill the recharge request.
OperadoraSaldo does not extend BaseEntityAudit — it has its own estado, created_at, and updated_at but does not carry id_user_create or id_user_update.RecargaCliente
RecargaCliente
Records a completed mobile top-up for an end customer. The
monto is deducted from the matching operator’s OperadoraSaldo.saldo_actual. The estado flag supports soft-delete for reversals.InyeccionOperadora
InyeccionOperadora
Records a balance injection — credit loaded into an operator’s pool from the POS. The source cash session (
id_caja_origen) is debited to reflect the outflow of funds used to purchase the airtime credit.Entity Relationship Summary
SesionCaja is the central hub for a cashier shift. All financial operations — sales, purchases, agent transactions, recargas, and cash movements — are anchored to a session, making it the primary unit for reporting and reconciliation.