TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DragonesMagicos/ferromax_v0.8/llms.txt
Use this file to discover all available pages before exploring further.
ADMIN role is reserved for business owners and managers who need full visibility and control over every system operation. Admins are the only users who can see purchase (cost) prices, supplier names, voided transactions, pending remito approvals, stock adjustment logs, and the invoice OCR pipeline. In a typical Ferromax installation, the admin is José Rodríguez — the store owner who monitors daily KPIs, reviews cash flow, and acts on low-stock alerts.
Default Credentials
TheDataInitializer seeds the following admin account on first boot if no users exist in the database:
| Field | Value |
|---|---|
[email protected] | |
| Password | admin123 |
| Role | ADMIN |
Accessible Modules
Dashboard
Real-time KPI summary (
/dashboard/resumen), sales-per-day chart for the last 7 days (/dashboard/ventas-semana), and the 10 most recent transactions (/dashboard/transacciones). The first page an admin sees after login.Products — Full CRUD
Full product list including
precioCompra (purchase/cost price) and nombreProveedor. Create, update, and deactivate products via POST /productos, PUT /productos/{id}, and DELETE /productos/{id}.Sales — Full History & Void
View all sales across all cashiers for any date range via
GET /ventas?desde=&hasta=. Void any transaction with PUT /ventas/{id}/anular. Employees only see their own daily sales.Stock Management
Post manual stock corrections via
POST /ajustes-stock (e.g., shrinkage, inventory count discrepancies). View full adjustment history via GET /ajustes-stock. Review and approve supplier remitos via GET /recepciones-remito/pendientes and PATCH /recepciones-remito/{id}/confirmar.Invoice Scanning (OCR)
Upload a supplier invoice image or PDF via
POST /facturas/analizar (multipart). The OCR service extracts line items; the admin reviews and confirms the stock ingestion via POST /facturas/confirmar. Historical invoice records are paginated at GET /facturas.Stock Alerts
GET /alertas returns all unread low-stock alerts; GET /alertas/todas shows the last 30 days. Mark individual alerts read with PUT /alertas/{id}/leer or clear all at once with PUT /alertas/leer-todas.Admin-Only API Endpoints
The table below lists every endpoint that requires theADMIN role, sourced directly from SecurityConfig.java, DashboardController.java, ProductoController.java, VentaController.java, AjusteStockController.java, FacturaController.java, AlertaController.java, and RecepcionRemitoController.java.
| Method | Path | Description |
|---|---|---|
GET | /dashboard/resumen | KPI summary (total sales today, stock alerts, cash flow) |
GET | /dashboard/ventas-semana | Daily sales totals for the last 7 days |
GET | /dashboard/transacciones | Last 10 transactions across all cashiers |
GET | /productos | Full product list including cost price and supplier |
GET | /productos/{id} | Product detail by ID (includes cost price) |
GET | /productos/sku/{sku} | Product lookup by SKU (includes cost price) |
GET | /productos/barcode/{codigo} | Product lookup by barcode (includes cost price) |
GET | /productos/stock-critico | Products below minimum stock threshold |
POST | /productos | Create a new product |
PUT | /productos/{id} | Update an existing product |
DELETE | /productos/{id} | Deactivate a product (soft delete) |
GET | /ventas | All sales with optional ?desde=&hasta= date filter |
PUT | /ventas/{id}/anular | Void a sale |
POST | /ajustes-stock | Post a manual stock adjustment |
GET | /ajustes-stock | Paginated stock adjustment history |
POST | /facturas/analizar | Upload invoice image/PDF for OCR analysis |
POST | /facturas/confirmar | Confirm and commit OCR-extracted stock ingestion |
GET | /facturas | Paginated list of processed invoices |
GET | /alertas | Unread low-stock alerts |
GET | /alertas/todas | All alerts from the last 30 days |
PUT | /alertas/{id}/leer | Mark a single alert as read |
PUT | /alertas/leer-todas | Mark all alerts as read |
GET | /recepciones-remito/pendientes | Remitos awaiting admin approval |
GET | /recepciones-remito | All remito receipts |
PATCH | /recepciones-remito/{id}/confirmar | Approve or reject a remito |
GET | /proveedores | Supplier list — also accessible to EMPLEADO |
POST, PUT, DELETE | /proveedores/** | Create, update, and delete suppliers — ADMIN-only |
The following endpoints are shared between ADMIN and EMPLEADO:
POST /ventas, GET /ventas/{id}, GET /ventas/{id}/detalle, POST /recepcion, POST /recepciones-remito, GET /recepciones-remito/mis-recepciones, GET /recepciones-remito/{id}, and GET /proveedores. See the Empleado page for the full shared-access list.Frontend Routes (Admin)
The React application (App.jsx) guards these pages with <ProtectedRoute requiereAdmin>, making them accessible only to admins:
| Route | Component | Description |
|---|---|---|
/ | DashboardPage | KPI dashboard — default landing page for admin |
/remitos | RemitosPage | Pending remito list and approval flow |
/ajuste-stock | AjusteStockPage | Manual stock adjustment form and history |
/ingreso-factura | IngresoFacturaPage | Invoice OCR upload and confirmation |
<ProtectedRoute requiereEmpleado> routes, because isEmpleado() in AuthContext.jsx returns true for both ADMIN and EMPLEADO roles:
| Route | Component | Description |
|---|---|---|
/pos | POS | Barcode-scanner POS terminal |
/recepcion | RecepcionPage | Single-item stock receipt form |
/productos | Productos | Product browser |
/ventas | Ventas | Full sales history (admins see all cashiers) |
What Admins Cannot Do
Despite their broad permissions, there are two things the ADMIN role cannot do through the API:
- Self-register. The
POST /auth/registerendpoint always assignsCLIENTE. Admin accounts must be created viaDataInitializeron first boot or through a direct database insert (UPDATE usuario SET rol = 'ADMIN' WHERE email = '...'). - Change another user’s role via the API. There is no
PUT /usuarios/{id}/rolendpoint in the current version. Role changes require direct database access.