Overview
TheCamion interface represents the core truck entity in Dashboard Backus. It tracks trucks throughout their journey from arrival to departure, including queue status, bay assignments, and alert states.
Camion Interface
Main entity that represents a truck in the system.React internal key (stringified database ID)
Foreign key reference to
viajes_camiones.id table — used for incident trackingUnique trip identifier from
viajes_camiones.id_viaje (text UNIQUE) — used for trip queriesLicense plate number (tracto)
Optional Frotcom fleet tracking identifier
Owner/operator name
Arrival date in “YYYY-MM-DD” format
Arrival time in “HH:MM:SS” format
Original truck type as text from database (e.g., “Parihuelero”, “Jumbo”)
Normalized truck type code:
P | J | B | T | OOperation type code:
C (Carga) | D (Descarga)Product type being loaded or unloaded (e.g., “Fardos”, “PP”, “PT”)
Timestamp in milliseconds when truck entered the yard (for local reference)
Timestamp in milliseconds when truck arrived at queue (traffic light)
Current alert status based on time thresholds:
verde | amarillo | rojoMaximum alert level reached during the trip (never downgrades)
Current bay assignment (e.g., “b1”, “b3”, “b10”)
Shift number:
1: 07:00–15:002: 15:01–23:003: 23:01–06:59
Counter of registered incidents (maximum 3)
True if there’s an open incident without
hora_fin — displays pulsing alert icon in bayTipoCamion Type
Truck type classification codes.Values
| Code | Type | Description |
|---|---|---|
P | Parihuelero | Standard flatbed truck with removable stakes |
J | Jumbo | Large capacity truck |
B | Bi-tren | Bi-train (truck with two trailers) |
T | Tolva | Dump truck with hopper |
O | Otros | Other truck types not classified above |
Type Mapping
The system normalizes database values to type codes:OperacionCodigo Type
Operation type classification.Values
| Code | Operation | Description |
|---|---|---|
C | Carga | Loading operation |
D | Descarga | Unloading operation |
Operation Detection
The system determines operation code from database text:EstadoAlerta Type
Traffic light alert status based on waiting time.Values
| State | Color | Description |
|---|---|---|
verde | Green | Normal — within acceptable time range |
amarillo | Yellow | Warning — approaching time threshold |
rojo | Red | Critical — exceeded maximum time threshold |
Color Mapping
Helper function returns hex color codes:Alert Thresholds
Alert states are calculated based on configurable time thresholds:- Verde:
0totiempoAmarillominutes - Amarillo:
tiempoAmarillototiempoRojominutes - Rojo:
tiempoRojominutes and above
tiempoAmarillo: 30 and tiempoRojo: 45 minutes.
Rol Type
User role classification for access control.Values
| Role | Description |
|---|---|
admin | Full access — can modify configurations, register incidents, and view all data |
cliente | Read-only access — can view dashboard but cannot modify data |
Usage Examples
Fetching Trucks from Queue
Type Guards
Bay Compatibility Check
Display Truck Type Name
Related Types
- BahiaConfig - Bay configuration and truck permissions
- VwUnidadPrioridad - Priority truck view
- ConfigSimulador - Simulator configuration with alert thresholds
Source
Defined insrc/types.ts:3-30