feat: add unit of measure tables and seed data for material types management

This commit is contained in:
Galindo97
2026-01-09 15:34:13 -06:00
parent 25c51120f9
commit 7abe79405e
5 changed files with 367 additions and 5 deletions

View File

@@ -37,11 +37,20 @@ export const materialTypesApi = {
* Lista todos los tipos de material con paginación
* @param page - Número de página (por defecto 1)
* @param pageSize - Tamaño de página (por defecto 50)
* @param type - Filtrar por tipo (ACTIVO FIJO, MATERIALES, PRODUCTOS)
*/
list: (page = 1, pageSize = 50) =>
api.get<MaterialTypeListResponse>(
`/v1/public/refrence_data/material-types?page=${page}&page_size=${pageSize}`
),
list: (page = 1, pageSize = 50, type?: string) => {
const params = new URLSearchParams({
page: page.toString(),
page_size: pageSize.toString()
});
if (type) {
params.append('type', type);
}
return api.get<MaterialTypeListResponse>(
`/v1/public/refrence_data/material-types?${params.toString()}`
);
},
/**
* Obtiene un tipo de material por key