Prompt file imported from rickandrew2/FleetWise (
.github/prompts/2026-04-11-seed-and-form-ux.prompt.md). Copyright stays with the author.
Context
FleetWise needs deterministic local development seed data and safer, user-friendly form UX. The current frontend still exposes raw UUID and EPA ID inputs, and currency display is inconsistent with Philippine peso requirements. Backend already has route/fuel alert logic and EPA lookup endpoint, which we will reuse/extend.
Decision
Implement in two strict phases:
- Backend dev-only seeding first with idempotent guards and realistic Philippine logistics data.
- Frontend UX/API improvements next, including users dropdown source endpoint, EPA lookup selection flow, auto-filled driver identity, UUID filter replacement, and full peso currency consistency.
Steps
- Add dev-only ApplicationRunner seeder with idempotent checks.
- Seed users/vehicles/fuel logs/route logs and fire alerts as required.
- Add users list endpoint for ADMIN/FLEET_MANAGER.
- Extend EPA lookup response with MPG data.
- Update frontend API/types for users and EPA lookup.
- Implement Add Vehicle lookup UX (no visible EPA ID input).
- Auto-fill driver in Fuel Log and Route forms from authenticated user.
- Replace UUID filters with dropdowns for fuel/routes/alerts.
- Centralize peso currency formatting and apply across frontend.
- Update tests and run backend/frontend validation.
Acceptance Criteria
- Dev profile startup seeds exactly the requested baseline and reruns without duplicate inserts.
- Route seeding triggers overconsumption alerts via existing AlertService rules.
- Two MAINTENANCE_DUE alerts are present for qualifying vehicles.
- Add Vehicle uses lookup flow and never exposes EPA ID input directly.
- Fuel/Route create forms no longer allow raw driver UUID entry; they submit current user driver ID.
- Fuel/Route/Alerts filters use dropdown selectors for vehicle and driver.
- Cost displays use Philippine peso symbol (PHP formatting) across dashboard and logs.
- Tests/build/lint pass after changes.
Status
- Not started / [ ] In progress / [x] Complete Blockers (if any):
- None.