Overview
The Guarantees (Garantías) entity manages warranty claims for spare parts that have failed or are defective. It tracks the entire lifecycle from reporting through resolution.Guarantee
Represents a warranty claim for a spare part.Properties
Unique identifier for the warranty claim
Date when the warranty was reported (ISO 8601 format)
Name of the spare part under warranty
Reference code of the spare part
Workshop or location where the failure occurred
Current status of the warranty claim (e.g., “pendiente”, “en_revision”, “aprobada”, “rechazada”, “resuelta”)
Name of the person who initiated the warranty claim
Work order number associated with the warranty claim
Name of the person who reported the issue
Name of the technician assigned to handle the warranty, if any
Description of the failure reason or defect
URL to photo evidence of the defect or failure
Comments about how the warranty was resolved
Vehicle mileage at the time of failure (if applicable)
Quantity of parts involved in the warranty claim
Spare part identifier
Technician ID associated with the claim
Example
Status Values
Common warranty status values:pendiente- Newly reported, awaiting reviewen_revision- Under investigationaprobada- Warranty claim approvedrechazada- Warranty claim rejectedresuelta- Warranty resolved (part replaced/refunded)cerrada- Case closed
API Methods
getGarantiasDashboard
Fetches all warranties for the current user’s location from the dashboard view.src/entities/guarantees/api/index.ts:5
Query Details:
- View:
v_garantias_dashboard - Filter: Current user’s location (
id_localizacion) - Ordering:
fecha_reportedescending (newest first)
updateGuaranteeStatus
Updates the status of a warranty claim.src/entities/guarantees/api/index.ts:21
Parameters:
id- The warranty ID to updatestatus- New status value (string)
- Sets the
estadofield to the new status - Automatically updates
updated_attimestamp
Example Usage Scenarios
Warranty Workflow
- Report: Technician reports defective part with evidence
- Review: Supervisor reviews claim and evidence
- Investigation: Technical team investigates failure cause
- Decision: Claim is approved or rejected
- Resolution: Approved claims trigger part replacement
- Closure: Resolved warranties are marked as closed
Impact on Inventory
When a warranty is approved:- Defective part is removed from inventory (Movement)
- Replacement part is issued to technician
- Timeline event is recorded in inventory history
Relationships
- References: Spare Part via
id_repuesto - Belongs to: Location via
taller_origen - Assigned to: User via
id_tecnico_asociado - Creates: Movements when resolved (replacement parts)
- Affects: Inventory stock levels