Overview
The Inventory entity represents items in stock at specific locations. It combines inventory-specific data (stock levels, position) with spare part information (reference, name, specifications).InventoryItem
Represents a complete inventory item with all related spare part data.Properties
Unique identifier for the inventory item (UUID format)
Location identifier where the item is stored
Current stock quantity available at this location
Physical position or bin location within the warehouse
Reference to the spare part entity
Spare part reference code or SKU
Name or description of the spare part
Minimum stock threshold that triggers reorder alerts
Indicates if the spare part has been discontinued
Type or category of the spare part
Estimated date for restocking or availability (ISO 8601 format)
URL to the spare part image
Stock status indicator (e.g., “disponible”, “bajo”, “agotado”)
Date when the item was added to inventory (ISO 8601 format)
Date until which the item is considered “new” (ISO 8601 format)
Example
InventoryParams
Parameters for filtering and paginating inventory queries.Properties
Page number for pagination
Number of items per page
Field to sort by
Sort direction
Search query to filter by name or reference
Filter by stock status
Filter by discontinued status
Filter to show only new items (where
nuevo_hasta > current date)PaginatedInventoryResponse
Response structure for paginated inventory queries.Properties
Array of inventory items for the current page
Total number of items matching the query
Current page number
Number of items per page
Total number of pages available
Example
TimelineEvent
Represents a historical event in the inventory timeline.Properties
Event timestamp (ISO 8601 format)
Type of inventory event
Event title or summary
Operation performed (e.g., “add”, “remove”, “adjust”)
Event status
Name of the user responsible for the event
Associated technician name, if applicable
General observations or notes
Additional contextual information
Work order number associated with the event
Related spare part identifier
Location where the event occurred
API Methods
getInventory
Fetches paginated inventory data from thev_inventario_completo view.
src/entities/inventario/api/index.ts:8
getAllInventoryItems
Retrieves all inventory items for autocomplete or dropdown components (limited to 1000 items).src/entities/inventario/api/index.ts:95
updateItemComplete
Updates an inventory item using theactualizar_item_inventario RPC function.
src/entities/inventario/api/index.ts:120
searchInventoryItems
Searches inventory by name or reference, returns up to 50 matches.src/entities/inventario/api/index.ts:152
searchRepuestos
Searches spare parts across inventory or the repuestos table.src/entities/inventario/api/index.ts:181
Relationships
- Belongs to: Location via
id_localizacion - References: SparePart via
id_repuesto - Related to: Movements - inventory changes from technical movements
- Related to: Guarantees - inventory affected by warranty claims