Categories provide the primary classification system for materials in Corpointa. Every material record requires a category assignment (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt
Use this file to discover all available pages before exploring further.
fk_id_categoria), making categories a foundational reference table that must be populated before materials can be created. Categories are available at the /categorias route, and their names appear throughout the application — in the Materials table, filter dropdowns, and the Stock por Categoría bar chart on the Analytics tab of the Dashboard.
Data Model
TheCategoria type is derived from the Zod schema in src/features/categorias/data/schema.ts.
Field Reference
| Field | Type | Constraints | Description |
|---|---|---|---|
id_categoria | number | Auto-assigned | Primary key. Referenced as fk_id_categoria in material records. |
nombre | string | Required, max 50 chars | Display name for the category (e.g., Eléctrico, Ferretería, Limpieza). |
Features
CRUD Table
A simple data table lists all categories with their names. Inline action menus on each row provide access to edit and delete operations.
Create Dialog
A compact modal form with a single
nombre field and client-side Zod validation. The record is persisted via POST /categorias.Edit Dialog
Pre-populates the form with the selected category’s current name. Changes are saved via
PUT /categorias/:id.Referenced by Materials
Any category that has associated materials will appear in the category filter dropdown on the Materials table and contribute data to the Dashboard’s Analytics chart.
API Operations
All functions live insrc/features/categorias/api/categorias.ts.
| Method | Endpoint | Function | Description |
|---|---|---|---|
GET | /categorias | getCategorias() | Returns all category records. |
GET | /categorias/:id | getCategoria(id) | Returns a single category by id_categoria. |
POST | /categorias | createCategoria(data) | Creates a new category. Body: { nombre: string }. |
PUT | /categorias/:id | updateCategoria(id, data) | Updates the name of an existing category. Body: { nombre: string }. |
DELETE | /categorias/:id | deleteCategoria(id) | Permanently removes a category record. |
Create Payload
When creating or updating a category,id_categoria is excluded from the request body: