Skip to main content

Documentation 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.

The Recargas module handles two distinct operations: client top-ups (RecargaCliente) — where a customer’s mobile number is recharged from the corresponding operator’s available balance — and operator balance injections (InyeccionOperadora) — where new airtime credit is loaded into an operator’s pool to replenish depleted stock. Both operations are tied to an active SesionCaja and tracked with full audit history. The OperadoraSaldo resource lets you query each operator’s current available balance before processing a top-up.

TypeScript Interfaces and Enums

export enum OperadoraNombre {
  TIGO  = "Tigo",
  ENTEL = "Entel",
  VIVA  = "Viva",
}

export interface OperadoraSaldo {
  id: number;
  nombre_operadora: OperadoraNombre;
  saldo_actual: number | string;
  estado: boolean;
  created_at: string; // ISO Date String
  updated_at: string; // ISO Date String
}

export interface RecargaCliente {
  id: number;
  operadora: OperadoraNombre;
  numero_cliente: string;
  monto: number | string;
  fecha_hora: string;      // ISO Date String
  id_caja_sesion: number;
  caja_sesion?: SesionCaja;
  estado: boolean;
}

export interface InyeccionOperadora {
  id: number;
  operadora_destino: OperadoraNombre;
  monto: number | string;
  fecha_hora: string;    // ISO Date String
  id_caja_origen: number;
  caja_origen?: SesionCaja;
  estado: boolean;
}

export interface CreateRecargaClienteDto {
  operadora: OperadoraNombre | "";
  numero_cliente: string;
  monto: number;
  id_caja_sesion: number;
}

export interface CreateInyeccionDto {
  operadora_destino: OperadoraNombre | "";
  monto: number;
  id_caja_sesion: number;
}

Endpoints

Get Operator Balances

GET /recargas/operadoras/saldos — Returns the current available balance for each configured operator (Tigo, Entel, Viva). Check this before processing a top-up to avoid rejections due to insufficient operator credit.
curl -X GET http://localhost:3000/recargas/operadoras/saldos \
  -H "Authorization: Bearer <access_token>"
Response: OperadoraSaldo[]
id
number
Unique operator record ID.
nombre_operadora
string
Operator name. One of: "Tigo", "Entel", or "Viva".
saldo_actual
number | string
Current available credit balance for this operator’s pool.
estado
boolean
Whether the operator is active and available for transactions.

Create a Client Top-Up

POST /recargas/cliente — Processes a mobile top-up for a customer. Deducts the specified amount from the corresponding operator’s balance pool and records the transaction against the active session.
operadora
string
required
Target mobile operator. Must be one of the OperadoraNombre enum values: "Tigo", "Entel", or "Viva".
numero_cliente
string
required
The customer’s mobile phone number to recharge (e.g., "76543210").
monto
number
required
Top-up amount in local currency. Must be greater than 0.
id_caja_sesion
number
required
ID of the currently active cashier session.
curl -X POST http://localhost:3000/recargas/cliente \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "operadora": "Tigo",
    "numero_cliente": "76543210",
    "monto": 30,
    "id_caja_sesion": 12
  }'
Response: RecargaCliente

Create an Operator Balance Injection

POST /recargas/inyeccion — Injects (adds) credit into an operator’s balance pool. Used when the system’s available balance for an operator runs low and needs to be replenished. The injection cost is recorded as an outflow against the active session’s cash.
operadora_destino
string
required
Operator receiving the balance injection. One of: "Tigo", "Entel", or "Viva".
monto
number
required
Amount of credit to inject into the operator’s pool.
id_caja_sesion
number
required
ID of the active session from which the cash outflow originates.
curl -X POST http://localhost:3000/recargas/inyeccion \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "operadora_destino": "Entel",
    "monto": 500,
    "id_caja_sesion": 12
  }'
Response: InyeccionOperadora

Get Client Top-Up History

GET /recargas/historial/clientes — Returns the full history of client top-up transactions.
curl -X GET http://localhost:3000/recargas/historial/clientes \
  -H "Authorization: Bearer <access_token>"
Response: RecargaCliente[]

Get Operator Injection History

GET /recargas/historial/inyecciones — Returns the full history of operator balance injections.
curl -X GET http://localhost:3000/recargas/historial/inyecciones \
  -H "Authorization: Bearer <access_token>"
Response: InyeccionOperadora[]

Operator Names Reference

Enum ValueString ValueDescription
OperadoraNombre.TIGO"Tigo"Tigo mobile network (Bolivia)
OperadoraNombre.ENTEL"Entel"Entel mobile network (Bolivia)
OperadoraNombre.VIVA"Viva"Viva mobile network (Bolivia)
Always use the string values from the OperadoraNombre enum when sending requests. Sending a raw string that does not match one of the three defined values may result in a validation error from the backend.

Build docs developers (and LLMs) love