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 lets your staff sell prepaid mobile credit (recargas) to customers and manage the underlying operator balances that fund those sales. Supported carriers are Tigo, Entel, and Viva — represented by the OperadoraNombre enum. There are two distinct operations: a Recarga Cliente (retail top-up) decrements the operator’s virtual balance pool, and an Inyección Operadora (wholesale balance injection) replenishes that pool from the active cash register.
Both operations require an active cash-register session. If CajaContext.sesionActiva is null, the /recargas/operacion page renders a blocking message with a link to open a shift at /cajas.

Core Types

// src/modules/Recargas/types/index.ts
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;
  updated_at: string;
}

export interface RecargaCliente {
  id: number;
  operadora: OperadoraNombre;
  numero_cliente: string;
  monto: number | string;
  fecha_hora: string;
  id_caja_sesion: number;
  caja_sesion?: any;
  estado: boolean;
}

export interface InyeccionOperadora {
  id: number;
  operadora_destino: OperadoraNombre;
  monto: number | string;
  fecha_hora: string;
  id_caja_origen: number;
  caja_origen?: any;
  estado: boolean;
}

export interface CreateRecargaClienteDto {
  operadora: OperadoraNombre | '';
  numero_cliente: string;    // Customer's phone number (e.g. "70712345")
  monto: number;
  id_caja_sesion: number;
}

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

Operations

Sell prepaid mobile credit to a customer. The operator’s virtual balance (saldo_actual) is decremented by monto. The cash-register session receives a corresponding INGRESO.Required fields:
FieldTypeDescription
operadoraOperadoraNombreTarget carrier: Tigo, Entel, or Viva.
numero_clientestringCustomer’s mobile phone number.
montonumberTop-up amount in Bolivianos.
id_caja_sesionnumberID of the currently open cash-register session.
Validation: The form checks whether monto > saldo_actual for the selected operator. If so, an inline warning banner appears and the submit button is disabled until the operator’s balance is sufficient.
// POST /recargas/cliente
const payload: CreateRecargaClienteDto = {
  operadora: OperadoraNombre.TIGO,
  numero_cliente: "70712345",
  monto: 20,
  id_caja_sesion: sesionActiva.id,
};
await RecargasService.createRecargaCliente(payload);

SaldosCards Component

The SaldosCards component renders a balance card for each operator retrieved from GET /recargas/operadoras/saldos. Each card displays the operator name, the current saldo_actual formatted in Bolivianos, and a brand-colored background: blue for Tigo, orange for Entel, and green for Viva.

RecargasOperacion Page

The main operations page at /recargas/operacion is composed from three blocks:
1

SaldosCards

Displays current virtual balances for all three operators fetched via RecargasService.getSaldos(). Refreshes after every successful transaction.
2

FormRecargaCliente

Left-panel form. Renders a carrier selector, phone number field, amount input with quick-select buttons (Bs. 10 / 20 / 50 / 100), and a submit button that calls RecargasService.createRecargaCliente().
3

FormInyeccionMayorista

Right-panel form. Renders a carrier selector, amount input, a reference/justification field, and a submit button that calls RecargasService.createInyeccion().

History Pages

Completed records are available in two separate history views:
PageRouteData source
Client top-up history/recargas/historial-clientesGET /recargas/historial/clientesRecargaCliente[]
Operator injection history/recargas/historial-inyeccionesGET /recargas/historial/inyeccionesInyeccionOperadora[]

REST Endpoints

// src/modules/Recargas/api/RecargasService.ts
export const RecargasService = {
  getSaldos(): Promise<OperadoraSaldo[]>
    // GET /recargas/operadoras/saldos

  getHistorialClientes(): Promise<RecargaCliente[]>
    // GET /recargas/historial/clientes

  getHistorialInyecciones(): Promise<InyeccionOperadora[]>
    // GET /recargas/historial/inyecciones

  createRecargaCliente(data: CreateRecargaClienteDto): Promise<RecargaCliente>
    // POST /recargas/cliente

  createInyeccion(data: CreateInyeccionDto): Promise<InyeccionOperadora>
    // POST /recargas/inyeccion
}
After each successful operation, RecargasOperacion calls loadSaldos() to refresh the SaldosCards. This gives the cashier immediate visual feedback that the operator’s pool balance has changed.

URL Routes

PagePath
Operations panel/recargas/operacion
Client top-up history/recargas/historial-clientes
Operator injection history/recargas/historial-inyecciones

Build docs developers (and LLMs) love