1.9 KiB
1.9 KiB
Phase 003 Execution
Scope
- Built the vehicle CRUD interface.
- Made the vehicle index the root page.
- Kept vehicle removal non-destructive by deactivating vehicles.
- Added request specs for the vehicle UI flows.
Changes
- Added
VehiclesControllerwith index, show, new, create, edit, update, and destroy actions. - Added
resources :vehiclesand changed the root route tovehicles#index. - Added plain ERB views for vehicle index, detail, new, edit, and the shared form.
- Added query-param filtering on the vehicle index:
- default shows active vehicles
status=inactiveshows inactive vehiclesstatus=allshows all vehicles
- Implemented
destroyas a deactivate action that setsactivetofalse. - Displayed maintenance schedules, fuel history, and maintenance history on
vehicles#show. - Ordered fuel and maintenance history newest first.
- Updated home specs for the new root behavior.
- Added vehicle request specs for successful and invalid create/update paths.
- Added licence plate normalization to uppercase before validation.
Decisions
- Vehicles are not hard-deleted because maintenance and fuel history must be preserved.
- The UI labels the destructive route as
Deactivateto match actual behavior. - The vehicle show page is display-only for related schedules and histories in this phase.
- Event creation remains reserved for Phase 004.
- Maintenance schedule CRUD remains reserved for Phase 006.
- Licence plates are standardized to uppercase before validation and storage.
Verification
- Passed:
bundle exec rspec spec/requests/vehicles_spec.rb - Passed:
bundle exec rspec - Passed for touched Phase 003 Ruby files:
bin/rubocop app/controllers/vehicles_controller.rb spec/requests/vehicles_spec.rb spec/requests/home_spec.rb spec/system/home_spec.rb - Full
bin/rubocopwas not clean because of pre-existing unrelatedGemfilesingle-quote offenses.