Overview
The Service Ticket model represents a repair service request in the Luis IT Repair system. It tracks devices from intake through completion, supporting laptops, PCs, printers, and monitors with device-specific fields.Firestore Collection
Collection Name:servicios
Index Collection: folios (for unique folio lookups)
Core Fields
Unique identifier for the service ticket (e.g., “HP/001”). Generated automatically based on device brand. Stored in the
folios collection for fast lookups.Reference to the client document ID in the
clientes collection. Used to link services to customer records.Customer name for this service ticket.
Customer phone number. Used for duplicate detection and customer lookup.
Customer address for service delivery or contact purposes.
Device Information
Type of device being serviced. Determines which device-specific fields are populated.Possible values:
laptoppcimpresora(printer)monitor
Device brand/manufacturer (e.g., “HP”, “Dell”, “Lenovo”). Used in folio generation.
Device model name or number.
Device serial number. Can be omitted if
omitirNumeroSerie is true.Flag indicating whether serial number was intentionally omitted.
Service Details
Description of the work to be performed or issue to be diagnosed.
Normalized version of
trabajo for duplicate detection (lowercase, no accents).Service cost. Empty if
precioDespues is true.Indicates if pricing will be determined after diagnosis.
Flag indicating that device characteristics need to be filled in later.
Status Tracking
Current service status. Normalized to lowercase with underscores.Common values:
pendiente- Initial stateen_proceso- Work in progressesperando_refacciones- Waiting for partslisto- Ready for pickupentregado- Delivered (final state)cancelado- Cancelled (final state)no_reparable- Cannot be repaired (final state)
Deprecated field. Use
status === "entregado" instead.Timestamp when service was marked as delivered. Set automatically when
status changes to “entregado”.Set to true when service reaches a final state (entregado, cancelado, no_reparable).
The final status that caused the service to be locked.
POS Integration
Indicates if this service was paid through the POS system.
Timestamp when payment was processed in POS.
Flag indicating that inventory has been adjusted for parts used in this service (boleta items).
Timestamp when inventory adjustment was made.
Device-Specific Fields
Laptop/PC (tipoDispositivo: "laptop" or "pc")
Printer (tipoDispositivo: "impresora")
Monitor (tipoDispositivo: "monitor")
Duplicate Detection
Composite key for duplicate detection. Format:
{telefono}|{tipoDispositivo}|{marca}|{modelo}Prevents creating multiple active services for the same device from the same customer.Timestamps
Service creation timestamp. Set automatically by Firestore.
Last update timestamp. Updated automatically on every change.
Example JSON
Related Functions
guardarServicio()- Create new service ticket with duplicate checkingbuscarServicioPorFolio()- Find service by folio (uses index)actualizarServicioPorId()- Update service status and detailslistarServiciosPendientes()- Get all non-final serviceslistarServiciosHistorial()- Get completed serviceslistarServiciosPorClienteId()- Get all services for a client
