Vehicles
Vehicles lists and updates vehicle operational data used by transport rounds, mileage checks, load capacity, and availability. Transport creation should use current vehicle status rather than stale list data.
App Entry Points
| App | Target |
|---|---|
| Mobile | VehicleList |
| POS Terminal | vehicle -> VehicleDetailForm |
Workflow
Data Rules
Status Update Flow
| Action | Rule |
|---|---|
| Search/list | Pagination is normalized and duplicate plates are removed before display. |
| Status | Only UNCHECKED, READY, and NOT_READY are persisted by the UI. |
| Save | Calls updateVehicleStatus; do not mutate the list optimistically without checking the server response. |
| Mileage | Mileage balance is read during transport start/finish and is not edited by this status form. |
| Transport selection | Non-ready status must be checked again when selecting the vehicle because list data may be stale. |
| Rule | Behavior |
|---|---|
| List source | getVehicles({ page, search }) from common services. |
| Dedupe | Terminal split list dedupes by licensePlate. |
| Status normalization | Unknown status defaults to READY; explicit UNCHECKED and NOT_READY are preserved. |
| Mileage | getVehicleMileage supports mileage checks around transport operations. |
| Transport dependency | Transport header uses license plate/driver data and should respect readiness. |
Permissions And Guards
| Topic | Behavior |
|---|---|
| Terminal menu key | vehicle |
| deptCode menu set | -2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 27 |
| Branch rule | Uses the same permission family as employee/operations access. |
| Operational guard | Do not assign unavailable vehicles to active transport rounds. |
Mobile vs POS Terminal
| Topic | Mobile | POS Terminal |
|---|---|---|
| Navigation | VehicleList | HomeScreen split-pane menu key vehicle |
| Detail | List-centered vehicle view | VehicleDetailForm |
| Status edit | Vehicle list/detail actions | Detail form actions |
| Transport use | Selected in transport flow | Used by TransportDetailForm |
Developer Handoff Map
| Area | Code |
|---|---|
| Mobile list | apps/mobile/src/screens/vehicleStack/vehicleListScreen/index.tsx |
| Terminal detail | apps/pos-terminal/src/screens/HomeScreen/VehicleDetailForm.tsx |
| Common service | getVehicles, updateVehicleStatus, getVehicleMileage in services/common.ts |
| Transport dependency | TransportDetailForm.tsx |