Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProcesosAgilesUMSS/sansistore/llms.txt

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

The SansiStore admin panel is the operational hub for platform administrators at UMSS. Accessible at /admin exclusively by users with the admin role, it renders the AdminProtectedLayout component which enforces role-based access before mounting any sub-section. The DashboardPanel component is the default landing view — it aggregates real-time KPIs from Firestore on mount and surfaces actionable alerts when reserved orders or cancellations require attention.

Accessing the Admin Panel

Navigate to /admin and sign in with an account that carries the admin role. Non-admin users are redirected away by AdminProtectedLayout. The dashboard greets the admin by first name and displays the current date in es-BO locale.
Only accounts with the admin role in their Firestore users document (and matching Firebase Auth custom claims) can access /admin. Attempting to load the page without the role results in an immediate redirect.

Dashboard KPIs

The DashboardPanel fetches four data streams in parallel on load:
KPISourceDescription
Pedidos hoygetSalesByDateRangeordersTotal orders created today (all statuses)
Ingresos hoygetSalesByDateRangeordersSum of total for ENTREGADO, COMPLETADO, PAGADO orders today
Sesiones activasgetAccessLogsaccessLogsUnique users whose last accessLogs entry today has status = ACTIVO
Hora pico hoygetDemandByHourordersHour with the highest order volume today (format HH:00)

Inline Alerts

Two alert banners appear below the KPIs when conditions are met:
  • RESERVADO orders — links to the pedidos section; warns that auto-cancellation may trigger if the reservation time limit expires.
  • Cancelled orders today — links to reportes-cancelados; displays the count of orders cancelled on the current day.

Recent Orders Widget

The dashboard displays the five most recent orders from today, showing order ID (truncated), buyer ID, total in Bolivianos, order status (color-coded), and creation time. The full list is accessible via the Ver todos link that navigates to the pedidos section.

Quick Access

Six shortcuts are available directly from the dashboard:
LabelSection key
Pedidospedidos
Reportesreportes
Bitácorabitacora
Demandademanda-horarios
Monitoreomonitoreo
Parámetrosparametros

Admin Sub-sections

Every sub-section below is available within the admin panel’s sidebar navigation.

Dashboard

KPI overview: today’s orders, revenue, active sessions, and peak demand hour. Default view on /admin.

Users

Manage user accounts at /admin/users/usuarios. Create, edit, enable/disable accounts and assign roles across the platform.

Categories

Manage product categories at /admin/categories. Create and update the category tree consumed by the product catalog.

Orders

Order reception panel (OrderReceptionPanel) for incoming orders, plus order history search by orderId via /api/admin/order_history.

Sales (Ventas)

Daily sales charts (DailySales) and top-selling products (TopSellingProducts) ranked by soldCount via /api/admin/top_products.

Demand Analysis

DemandPanel shows hourly order distribution for any date range. Powered by getDemandByHour over the orders collection.

Messenger Performance

Per-courier delivery KPIs: total deliveries, average delivery time in minutes, and recent completed deliveries. Sourced from messengerPerformanceService.

Courier Sessions

Session validation panel at /api/admin/courier_sessions. Admins review messenger_shift_closures documents and approve or reject them.

Analytics

Sales reports, top products, demand trends, cancelled order reports, seller activity logs, and paginated order lists.

Reconciliation

PaymentReconciliationPanel cross-references delivered orders against the payments collection and flags discrepancies.

Monitoring

SellerActivityPanel streams the sellerActivityLogs collection — every status transition made by sellers on orders.

Reports

CancelledOrdersReport summarises cancelled orders by period (day / week / month) including cancellation reasons.

Audit

AccessLogPanel displays the accessLogs collection — every LOGIN and LOGOUT event with user, role, and timestamp.

Settings

ConfigPanel reads and writes the singleton settings/config document. Currently exposes reservationTimeLimit (minutes).

Database Management

OrdersManagementPanel with EditOrderModal and DeleteOrderModal for direct order document editing and deletion via ordersAdminService.
Only users with the admin role can validate courier sessions (approve/reject messenger_shift_closures) and reconcile payments in the PaymentReconciliationPanel. No other role has write access to these operations.

Order Status Reference

The dashboard and order panels use the following status color mapping:
StatusMeaning
CREADOOrder placed, not yet reserved
RESERVADOReserved by a seller; subject to time-limit cancellation
CONFIRMADOConfirmed by seller
EMPAQUETADOPacked and ready
LISTOReady for pickup by courier
ASIGNADOAssigned to a courier
ENTREGADOSuccessfully delivered
COMPLETADOCompleted (seeder/legacy)
PAGADOPaid (seeder/legacy)
CANCELADOCancelled

Build docs developers (and LLMs) love