Every resource in the Kantuta POS API maps directly to a TypeORM entity backed by a PostgreSQL table. This page documents the shape of each entity as a TypeScript interface so your frontend can consume the API with full type safety. Copy the interfaces at the bottom of this page into aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
src/types/api.d.ts file in your React project — they reflect the actual JSON shapes returned by every endpoint, including all nested relations.
BaseEntityAudit
Almost every entity in the system extendsBaseEntityAudit. These fields are present on every response object unless explicitly excluded:
Soft delete: All entities with
estado: boolean use false to mark a record as deleted rather than physically removing it. Always filter for estado === true when displaying lists to users.| Field | Description |
|---|---|
estado | Active flag. true = visible/active; false = soft-deleted |
id_user_create | Audit field — who created this record |
id_user_update | Audit field — who last modified this record |
created_at | Auto-set by TypeORM @CreateDateColumn |
updated_at | Auto-updated by TypeORM @UpdateDateColumn on every save |
Identity & Access
Role — User roles
Role — User roles
Defines the authorization level of a user account.
| Field | Notes |
|---|---|
id | 1 = Administrador, 2 = Operador |
nombre | Used by RolesGuard for authorization checks. The guard recognizes both 'admin'/'Administrador' (role ID 1) and 'user'/'Operador' (role ID 2). |
Persona — Natural person profile
Persona — Natural person profile
Stores the personal identity information linked to a user account.
| Field | Notes |
|---|---|
p_apellido | First (paternal) surname |
s_apellido | Second (maternal) surname — optional |
fecha_nacimiento | ISO date string without time component |
Usuario — System user account
Usuario — System user account
Represents an operator or administrator who can log in and use the POS.
The
password field is excluded from all API responses by the global ClassSerializerInterceptor. You will never receive it in JSON.Inventory
Categoria — Product category
Categoria — Product category
Groups products into logical categories for filtering and reporting.
Producto — Inventory product
Producto — Inventory product
Represents a sellable item with pricing, stock levels, and barcode information.
| Field | Notes |
|---|---|
codigo_barras | Optional — used for barcode scanner lookups at the POS terminal |
stock_minimo | When stock_actual drops below this, a low-stock alert is triggered |
categoria | Loaded eagerly via { eager: true } — no separate query needed |
Cash Registers
Caja — Physical cash drawer
Caja — Physical cash drawer
Represents a physical POS terminal/cash drawer. Each caja has a defined specialty that restricts what operations it can process.
especialidad value | Allowed operations |
|---|---|
SOLO_VENTAS | Product sales only |
SOLO_AGENTES | External agent transactions only |
MIXTA | Both sales and agent transactions |
SesionCaja — Shift session
SesionCaja — Shift session
Represents one cashier’s open shift on a specific
Caja. Opens with an initial float and closes after reconciliation.| Field | Notes |
|---|---|
monto_final_teorico | Calculated by the backend: initial float + all INGRESO movements − all EGRESO movements |
diferencia | Positive = overage (surplus cash); negative = shortage |
MovimientoCaja — Cash movement
MovimientoCaja — Cash movement
Records a manual cash-in or cash-out event within an open session (e.g., petty cash withdrawal, cash received for float top-up).
Sales & Purchases
DetalleVenta — Sale line item
DetalleVenta — Sale line item
One product line within a sale. The backend calculates
subtotal = cantidad × precio_unitario and reduces stock_actual of the referenced product automatically.Venta — Sale transaction
Venta — Sale transaction
A complete point-of-sale transaction, containing one or more
DetalleVenta line items.estado_venta value | Meaning |
|---|---|
COMPLETADA | Sale processed successfully — stock already reduced |
ANULADA | Sale voided — stock is not automatically restored via this field |
EDITADA | Sale was modified after creation — motivo_edicion is required |
DetalleCompra — Purchase line item
DetalleCompra — Purchase line item
One product line within a supplier purchase. The backend increases
stock_actual and updates costo_compra on the referenced product.Compra — Supplier purchase
Compra — Supplier purchase
Records the acquisition of stock from a supplier. If
pagado_con_caja is true, an EGRESO MovimientoCaja is automatically created in the linked session.Agents & Recargas
TransaccionAgente — Financial agent operation
TransaccionAgente — Financial agent operation
Records an external financial service operation (mobile money, QR payment, bank transfer) handled through the POS terminal acting as a financial agent.
tipo_operacion value | Description |
|---|---|
DEPOSITO | Customer deposits cash through the agent |
RETIRO | Customer withdraws cash through the agent |
TRANSFERENCIA_QR | QR-based transfer processed at the terminal |
Complete TypeScript Interface File
Copy the block below intosrc/types/api.d.ts in your frontend project for full end-to-end type coverage: