F5.1 · Inventario limpio, jerarquía manual y Hallazgos filtrados (#28)

Reset controlado de datos operativos e históricos, nueva jerarquía manual Departamento → Área → Yacimiento → Instalación → Subinstalación, filtros y administración inline de Hallazgos, y corrección de alta con Área sin Operadora.
This commit is contained in:
2026-09-09 08:55:01 -03:00
committed by GitHub
parent 3d83545033
commit 7338f277ad
16 changed files with 816 additions and 498 deletions
+39 -1
View File
@@ -6,6 +6,28 @@ import type {
PageMeta,
} from './api';
export interface InventoryBrowserDepartment {
id: string;
code: string;
name: string;
commonName: string | null;
type: { id: string; code: string; name: string };
informationStatus: AssetInformationStatus;
operationalStatus: AssetOperationalStatus;
areaCount: number;
childrenCount: number;
}
export interface InventoryBrowserCompany {
id: string;
code: string;
name: string;
commonName: string | null;
type: { id: string; code: string; name: string };
informationStatus: AssetInformationStatus;
areaCount: number;
}
export interface InventoryBrowserArea {
id: string;
code: string;
@@ -31,6 +53,7 @@ export interface InventoryBrowserItem {
isInventoryInstance: boolean;
inventoryFamily: { id: string; code: string; name: string; level: string } | null;
childrenCount: number;
findingCount: number;
hasGeometry: boolean;
updatedAt: string;
}
@@ -85,12 +108,27 @@ function queryString(params: InventoryQuery): string {
return query.size ? `?${query}` : '';
}
export function listRealInventory(params: InventoryQuery = {}) {
export function listInventory(params: InventoryQuery = {}) {
return apiRequest<{ data: InventoryListItem[]; meta: PageMeta }>(
`/inventory-browser/items${queryString(params)}`,
);
}
// Compatibility alias while old call sites are removed.
export const listRealInventory = listInventory;
export function listInventoryDepartments(params: InventoryQuery = {}) {
return apiRequest<{ data: InventoryBrowserDepartment[]; meta: { count: number } }>(
`/inventory-browser/departments${queryString(params)}`,
);
}
export function listInventoryCompanies(params: InventoryQuery = {}) {
return apiRequest<{ data: InventoryBrowserCompany[]; meta: { count: number } }>(
`/inventory-browser/companies${queryString(params)}`,
);
}
export function listInventoryAreas(params: InventoryQuery = {}) {
return apiRequest<{ data: InventoryBrowserArea[]; meta: { count: number } }>(
`/inventory-browser/areas${queryString(params)}`,