Categories give every financial movement a semantic label that goes beyond the raw amount and date. When you record a grocery run you tag it as “Supermercado”; when a salary arrives you tag it as “Salario”. Leo Counter uses those tags to group and aggregate data across the KPI, trend, and distribution charts in the reports module, making it easy to see which spending areas consume the most budget each month.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
The Category Model
Categories are stored in thecategorias table and support soft deletes, so removed categories are preserved in the historical record and can be restored by an admin.
Category Fields
The category label (max 255 characters). Must be unique within the same movement type.
Classifies the category as income (
1) or expense (2). This value is validated against the tipo_movimientos table.Optional longer description of what belongs in this category (max 1,000 characters).
The es_fijo Flag
The es_fijo boolean marks a category as “fixed” — meaning it is associated with recurring obligations rather than one-off purchases. When you create a fixed movement (MovimientoFijo), best practice is to use a category where es_fijo = true so that the reports engine can filter by fixed-only categories if needed.
You toggle es_fijo without editing the full category form:
{attribute} is es_fijo. The ToggleCategoryCommand is dispatched and the flag is flipped atomically.
The
es_fijo flag does not restrict which movements can use the category — it is a soft metadata tag. Any movement type can reference any category regardless of this flag.System Categories
Theis_system boolean marks categories that are seeded by the application itself and cannot be deleted through the UI. These exist to ensure baseline reporting always has valid data.
Category Routes
| Method | URI | Action |
|---|---|---|
| GET | /categorias | List all categories |
| GET | /categorias/create | Show creation form |
| POST | /categorias | Store a new category |
| GET | /categorias/{id}/edit | Show edit form |
| PUT | /categorias/{id} | Update a category |
| DELETE | /categorias/{id} | Soft-delete a category |
| PATCH | /categorias/{id}/{attribute}/toggle | Toggle es_fijo flag |
How Categories Appear in Reports
TheCategoryDistributionAssembler aggregates all movements in the selected period, groups them by category, and returns a FullCategoryDistributionDTO containing the total movement count across categories:
Soft Deletes and Restoration
Deleting a category is a soft delete — the record is flagged with adeleted_at timestamp and hidden from lists and forms, but never physically removed. Admins can restore or permanently hard-delete categories from:
Best Practices: Suggested Household Category Structure
Income categories (tipo_movimiento_id = 1)
Income categories (tipo_movimiento_id = 1)
| Category | es_fijo | Typical use |
|---|---|---|
| Salario | true | Monthly fixed salary |
| Freelance | false | Variable project payments |
| Transferencia recibida | false | One-off bank transfers |
| Reembolso | false | Expense reimbursements |
Expense categories (tipo_movimiento_id = 2)
Expense categories (tipo_movimiento_id = 2)
| Category | es_fijo | Typical use |
|---|---|---|
| Vivienda (Arriendo/Hipoteca) | true | Monthly housing cost |
| Servicios públicos | true | Utilities billed monthly |
| Supermercado | false | Weekly grocery runs |
| Transporte | false | Fuel, public transit |
| Salud | false | Medical and pharmacy |
| Educación | true | Tuition or subscriptions |
| Entretenimiento | false | Dining out, streaming |
| Seguros | true | Insurance premiums |