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).
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Relates to #196
Summary
Update dashboard types and extend
useDashboardDatahook 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-- addVehicleHealth,AttentionItem,VehicleRosterDatatypesfrontend/src/features/dashboard/hooks/useDashboardData.ts-- extend to fetch documents per vehicle, compute healthAcceptance Criteria
VehicleHealth(green/yellow/red),AttentionItem(label, urgency, type),VehicleRosterData(vehicle + health + attention items + odometer)useDashboardDatafetches document expiry data per vehicle (insurance, registration with expirationDate)useVehicleRoster()derived hook returningVehicleRosterData[]