feat: Dashboard types and vehicle health data layer (#196) #197

Closed
opened 2026-02-15 16:30:52 +00:00 by egullickson · 0 comments
Owner

Relates to #196

Summary

Update dashboard types and extend useDashboardData hook to fetch document expiry data per vehicle. Add vehicle health computation utility that aggregates maintenance schedule status and document expiry into a per-vehicle health color (green/yellow/red).

Files

  • frontend/src/features/dashboard/types/index.ts -- add VehicleHealth, AttentionItem, VehicleRosterData types
  • frontend/src/features/dashboard/hooks/useDashboardData.ts -- extend to fetch documents per vehicle, compute health

Acceptance Criteria

  • New types defined: VehicleHealth (green/yellow/red), AttentionItem (label, urgency, type), VehicleRosterData (vehicle + health + attention items + odometer)
  • useDashboardData fetches document expiry data per vehicle (insurance, registration with expirationDate)
  • Health computation: GREEN (nothing overdue or due within 14 days), YELLOW (items due within 14 days), RED (overdue maintenance or expired documents)
  • Attention items sorted by urgency (overdue first, then by days until due), max 3 per vehicle
  • Hook exports useVehicleRoster() derived hook returning VehicleRosterData[]
  • TypeScript compiles with no errors
Relates to #196 ## Summary Update dashboard types and extend `useDashboardData` hook to fetch document expiry data per vehicle. Add vehicle health computation utility that aggregates maintenance schedule status and document expiry into a per-vehicle health color (green/yellow/red). ## Files - `frontend/src/features/dashboard/types/index.ts` -- add `VehicleHealth`, `AttentionItem`, `VehicleRosterData` types - `frontend/src/features/dashboard/hooks/useDashboardData.ts` -- extend to fetch documents per vehicle, compute health ## Acceptance Criteria - [ ] New types defined: `VehicleHealth` (green/yellow/red), `AttentionItem` (label, urgency, type), `VehicleRosterData` (vehicle + health + attention items + odometer) - [ ] `useDashboardData` fetches document expiry data per vehicle (insurance, registration with expirationDate) - [ ] Health computation: GREEN (nothing overdue or due within 14 days), YELLOW (items due within 14 days), RED (overdue maintenance or expired documents) - [ ] Attention items sorted by urgency (overdue first, then by days until due), max 3 per vehicle - [ ] Hook exports `useVehicleRoster()` derived hook returning `VehicleRosterData[]` - [ ] TypeScript compiles with no errors
egullickson added the
status
backlog
type
feature
labels 2026-02-15 16:31:44 +00:00
egullickson added this to the Sprint 2026-02-02 milestone 2026-02-15 16:31:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#197