Overview
The Spare Parts entity (Repuesto) represents the master catalog of auto parts. Each spare part can exist in multiple inventory locations with different stock levels.Repuesto
Core spare part entity with catalog information.Properties
Unique identifier for the spare part
Part reference code or SKU
Name or description of the part
Whether the part has been discontinued
Part category or type (e.g., “Frenos”, “Motor”, “Suspensión”)
Estimated date for restocking (ISO 8601 format)
URL to the part image
Timestamp when the part was created (ISO 8601 format)
Brand or manufacturer name
Detailed description of the part
Extended Properties (from vista_repuestos_inventario)
These fields are available when querying through inventory views:Current stock at the location
Physical storage position
Number of times the part has been counted
Stock status (e.g., “disponible”, “bajo”, “agotado”)
Minimum stock threshold
Date until which the item is marked as “new”
Name of the location where stock exists
Part creation date
Whether the stock is below minimum threshold
Whether the part is currently marked as new
Example
RepuestosParams
Query parameters for fetching spare parts.Properties
Page number for pagination
Number of items per page
Search query to filter by name or reference
Filter by part type/category
Filter by discontinued status
Field to sort results by
Sort direction
PaginatedRepuestosResponse
Paginated response structure for spare parts queries.Properties
Array of spare parts for the current page
Total number of parts matching the query
Current page number
Items per page
Total number of pages
RepuestoFormData
Data structure for creating or updating spare parts.Properties
Part reference code
Part name
Discontinued status
Part type/category
Estimated restock date
Image URL
Brand name
Detailed description
Example
API Methods
getRepuestos
Fetches paginated spare parts from the database.src/entities/repuestos/api/index.ts:4
createRepuesto
Creates a new spare part in the catalog.src/entities/repuestos/api/index.ts:55
updateRepuesto
Updates an existing spare part.src/entities/repuestos/api/index.ts:70
deleteRepuesto
Deletes a spare part from the catalog.src/entities/repuestos/api/index.ts:86
Relationships
- Has many: Inventory Items - stock levels at different locations
- Used in: Movements - technical movements of parts
- Referenced by: Requests - cart items for part requests
- Appears in: Guarantees - warranty claims for parts