diff --git a/web-v2/src/lib/inventoryStructureApi.ts b/web-v2/src/lib/inventoryStructureApi.ts index 8533f3d..3ff41ac 100644 --- a/web-v2/src/lib/inventoryStructureApi.ts +++ b/web-v2/src/lib/inventoryStructureApi.ts @@ -21,7 +21,15 @@ export interface InventoryTechnicalValues { values:Record; } export interface InventoryStructureLevel { kind:InventoryStructureKind; label:string; type:{id:string;code:string;name:string}; parentKind:InventoryStructureKind|null; requiresFamily:boolean; } -export interface InventoryStructureOptions { independentMasters:InventoryStructureLevel[]; levels:InventoryStructureLevel[]; installationFamilies:InventoryFamily[]; subinstallationFamilies:InventoryFamily[]; } +export interface InventoryStructureOption { id:string; code:string; name:string; } +export interface InventoryStructureOptions { + independentMasters:InventoryStructureLevel[]; + levels:InventoryStructureLevel[]; + companies:InventoryStructureOption[]; + concessionTypes:InventoryStructureOption[]; + installationFamilies:InventoryFamily[]; + subinstallationFamilies:InventoryFamily[]; +} export interface InventoryStructureParent { id:string; code:string; name:string; commonName:string|null; type:{id:string;code:string;name:string}; inventoryFamily:null|{id:string;code:string;name:string;level:'INSTALLATION'|'SUBINSTALLATION';informationLabels:string[]}; @@ -35,6 +43,8 @@ export interface InventoryFamilyFindings { family:InventoryFamily; items:Invento export interface CreatedInventoryStructure { id:string; code:string; name:string; commonName:string|null; description:string|null; informationStatus:string; operationalStatus:string; type:{id:string;code:string;name:string}; parent:null|{id:string;code:string;name:string}; operationalArea?:null|{id:string;code:string;name:string}; + operatorCompany?:null|{id:string;code:string;name:string}; + concessionType?:null|{id:string;code:string;name:string}; inventoryFamily:null|{id:string;code:string;name:string;level:string;informationLabels:string[]}; } @@ -53,4 +63,4 @@ export function updateInventoryFamily(familyId:string,input:{name?:string;parent export function createInventoryFamilyAttribute(familyId:string,input:{code:string;name:string;dataType:InventoryFamilyAttributeDataType;isRequired?:boolean;unit?:string|null;options?:string[];sortOrder?:number}){return apiRequest(`/inventory-families/${familyId}/attributes`,{method:'POST',body:JSON.stringify(input)});} export function updateInventoryFamilyAttribute(familyId:string,attributeId:string,input:{name?:string;dataType?:InventoryFamilyAttributeDataType;isRequired?:boolean;isActive?:boolean;unit?:string|null;options?:string[]|null;sortOrder?:number}){return apiRequest(`/inventory-families/${familyId}/attributes/${attributeId}`,{method:'PATCH',body:JSON.stringify(input)});} export function replaceInventoryFamilyFindings(familyId:string,input:{itemIds:string[];reason:string}){return apiRequest(`/inventory-families/${familyId}/findings`,{method:'PUT',body:JSON.stringify(input)});} -export function createInventoryStructure(input:{kind:InventoryStructureKind;code?:string|null;name:string;commonName?:string|null;parentId?:string|null;familyId?:string|null;description?:string|null}){return apiRequest('/inventory-structure',{method:'POST',body:JSON.stringify(input)});} +export function createInventoryStructure(input:{kind:InventoryStructureKind;code?:string|null;name:string;commonName?:string|null;parentId?:string|null;familyId?:string|null;operatorCompanyId?:string|null;concessionTypeId?:string|null;description?:string|null}){return apiRequest('/inventory-structure',{method:'POST',body:JSON.stringify(input)});}