Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dinogamer089/SiCom/llms.txt

Use this file to discover all available pages before exploring further.

SiCom’s analytics module provides four distinct dashboard views, each focused on a different operational dimension. All four are accessible only to administrators and are backed by FacadeDashboard, which centralises all metric queries. Charts are rendered using PrimeFaces’ built-in BarChartModel and PieChartModel components, which wrap Chart.js under the hood and require no additional front-end dependencies.

Dashboard Views at a Glance

View (XHTML)Managed Bean@NamedScopeFocus
Dashboard.xhtmlDashboardBeanUIdashboardBean@ViewScopedMain KPIs, period comparison bar chart, top-articles pie chart
DashboardRentas.xhtmlDashboardRentasBeanUIdashboardRentasBean@ViewScopedDaily rental trend, stacked bar chart, activity heatmap
DashboardCotizaciones.xhtmlDashboardCotizacionesBeanUIdashboardCotizacionesBean@ViewScopedQuotation funnel, conversion rate, effectiveness by ticket size
DashboardClientes.xhtmlDashboardClientesBeanUIdashboardClientesBean@ViewScopedClient growth line chart, frequency ranking bar chart

Main Dashboard — DashboardBeanUI

DashboardBeanUI is the primary entry point. It computes metrics for a selectable time range and builds two charts on every refresh.

Range Selection

rangoSeleccionadoBehaviour
HOYCompares today’s figures against yesterday
ULTIMOS_30Compares the last 30 days against the preceding 30-day period
ULTIMOS_NCompares the last N days against the preceding N-day period; diasN defaults to 7
Calling updateDashboard() re-fetches metrics from FacadeDashboard.calcularMetricas(rangoSeleccionado, diasN) and rebuilds both chart models.
// Entry point called at @PostConstruct and on every range change
public void updateDashboard() {
    this.metrics = facade.calcularMetricas(rangoSeleccionado, diasN);
    createBarModel();
    createPieModel();
}

DashboardMetricsDTO Fields

FacadeDashboard.calcularMetricas() returns a DashboardMetricsDTO that carries all the data both charts and the KPI cards need:
FieldTypeDescription
totalRentaslongCount of successful rentals in the current period
dineroRentasBigDecimalRevenue from rentals in the current period
promedioGananciaBigDecimalAverage revenue per rental in the current period
totalRentasPctdouble% change in rental count vs. prior period
dineroRentasPctdouble% change in revenue vs. prior period
promedioGananciaPctdouble% change in average revenue vs. prior period
dineroRentasAnteriorBigDecimalPrior period revenue (for tooltip display)
promedioGananciaAnteriorBigDecimalPrior period average revenue (for tooltip display)
rentasExitosasActuallongCompleted rentals in current period
rentasExitosasAnteriorlongCompleted rentals in prior period
rentasCanceladasActuallongCancelled rentals in current period
rentasCanceladasAnteriorlongCancelled rentals in prior period
cotizacionesActuallongNew quotations in current period
cotizacionesAnteriorlongNew quotations in prior period
topArticulosList<TopArticuloDTO>Top rented articles by quantity
topArticulosTotalCantidadlongSum of quantities across all top articles
periodoActualInicioDateStart of the current comparison window
periodoActualFinDateEnd of the current comparison window
periodoAnteriorInicioDateStart of the prior comparison window
periodoAnteriorFinDateEnd of the prior comparison window

Bar Chart — Period Comparison

createBarModel() builds a grouped BarChartModel with two datasets — one for the current period and one for the prior period — and three categories: Exitosas (completed rentals), Canceladas, and Cotizaciones. The dataset labels include the formatted date ranges so the comparison window is always visible in the chart legend.

Pie Chart — Top Articles

createPieModel() builds a PieChartModel from metrics.getTopArticulos(). Each TopArticuloDTO contributes one slice:
TopArticuloDTO FieldTypeDescription
idintArticle primary key
nombreStringArticle display name
cantidadlongTotal units rented in the period
porcentajedoubleShare of total rented units (set by the facade)
Up to six distinct colours from the Chart.js default palette are cycled across slices.

KPI Percentage Helpers

Two bean methods format the comparison deltas for the KPI cards:
// Returns a colour string: "green", "red", or "gray"
public String getPctColor(double pct) { ... }

// Returns a formatted string like "+12.5%" or "—" if zero/NaN
public String formatPct(double pct) { ... }
The phrase methods getFraseTotalRentas(), getFraseDineroRentas(), and getFrasePromedioGanancia() produce human-readable comparison lines such as "hoy +8.0% vs ayer" or "últ. 7 días −3.2% vs previos".

Rentals Dashboard — DashboardRentasBeanUI

DashboardRentasBeanUI provides a month-scoped view defaulting to the current calendar month (fechaInicio = first of month, fechaFin = last of month). It exposes two complementary visuals:
  • Stacked bar chart (stackedBarModel): daily counts of completed (green) and cancelled (red) rentals, rendered using ChartDataSet.setStack("rentas") to stack both series per day.
  • Activity heatmap (heatmap): a calendar-style grid of WeekRow objects, each containing HeatCell entries coloured by rental volume relative to the peak day. High-activity days appear darker green.
KPI cards show totalCompletadas, totalCanceladas, and tasaCancelacion as a percentage string.

Quotations Dashboard — DashboardCotizacionesBeanUI

DashboardCotizacionesBeanUI visualises quotation conversion, also scoped to the current month by default. It surfaces:
  • Funnel KPIs: cotizacionesCreadas, cotizacionesAprobadas, cotizacionesPagadas, and tasaConversion (paid ÷ created × 100).
  • Revenue KPIs: montoCotizado and montoCerrado from CotizacionMontosDTO.
  • Funnel stages: a List<FunnelStage> record (label, count, % of created, colour) rendered as progressively narrowing bars.
  • Effectiveness chart (efectividadModel): a grouped bar chart comparing quoted vs. rented counts across three ticket-size buckets — Pequeño (< 5k),Mediano(5 k), *Mediano* (5 k–20k),andVIP/Boda(>20 k), and *VIP/Boda* (> 20 k).

Clients Dashboard — DashboardClientesBeanUI

DashboardClientesBeanUI tracks client acquisition and engagement over the current month by default. It exposes:
  • KPI counters: clientesTotales, clientesNuevos, and clientesFrecuentes for the selected date window.
  • Growth line chart (growthModel): a filled LineChartModel showing the cumulative client count by day, sorted chronologically. Day-of-month labels are used on the x-axis.
  • Frequency ranking bar chart (rankingModel): a horizontal BarChartModel displaying the top 10 clients by interaction count, sorted descending.
Both charts are refreshed by calling recargar(), which is also triggered when fechaInicio or fechaFin changes.
Use rangoSeleccionado = "ULTIMOS_N" with different values of diasN on the main dashboard to quickly compare short windows (e.g. last 7 vs. previous 7 days) against longer windows (last 30 vs. previous 30 days). The chart legend labels update automatically to show the exact date ranges being compared, making it easy to spot seasonal patterns or the impact of a particular promotion.

Build docs developers (and LLMs) love