Planned and executed phase001
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# Phase 001: Project Baseline And Testing Setup
|
||||
|
||||
## Goal
|
||||
Establish a stable Rails/RSpec foundation before adding application behavior.
|
||||
|
||||
## Work
|
||||
- Confirm `rspec-rails` is installed and usable.
|
||||
- Ensure `bin/rails spec` or the project-preferred test command works.
|
||||
- Add initial request/system/model spec patterns for future phases.
|
||||
- Decide whether the app should use Rails fixtures or FactoryBot; prefer FactoryBot because it is already in the Gemfile.
|
||||
- Add a simple root page placeholder so the app has a visible landing point.
|
||||
|
||||
## Deliverables
|
||||
- Working test suite.
|
||||
- Root route and minimal home page.
|
||||
- Documented test command.
|
||||
|
||||
## Acceptance Criteria
|
||||
- Test suite passes.
|
||||
- Root path returns success.
|
||||
- No application models are added without corresponding specs.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Phase 002: Core Data Model
|
||||
|
||||
## Goal
|
||||
Create the relational model foundation for users, vehicles, fuel entries, maintenance entries, and maintenance schedules.
|
||||
|
||||
## Work
|
||||
- Create `User` with `name` and `email`.
|
||||
- Create `Vehicle` with `make`, `model`, `year`, `color`, `vin`, `licence_plate`, `current_odometer`, and `fuel_tank_size`.
|
||||
- Create `MaintenanceSchedule` belonging to `Vehicle`.
|
||||
- Create `FuelEntry` belonging to `Vehicle` and `User` as `updated_by_user`.
|
||||
- Create `MaintenanceEntry` belonging to `Vehicle` and `User` as `updated_by_user`.
|
||||
- Add validations for required fields and basic numeric constraints.
|
||||
- Add model specs for associations, validations, and simple behavior.
|
||||
|
||||
## Notes
|
||||
- Correct likely typo from design: `licence_place` should probably be `licence_plate`.
|
||||
- Correct likely typo from design: `MainetnanceEntry` should be `MaintenanceEntry`.
|
||||
|
||||
## Deliverables
|
||||
- Database migrations.
|
||||
- ActiveRecord models.
|
||||
- Model specs.
|
||||
- Factories.
|
||||
|
||||
## Acceptance Criteria
|
||||
- All model specs pass.
|
||||
- Associations match the design.
|
||||
- Invalid records are rejected with useful validation errors.
|
||||
@@ -0,0 +1,22 @@
|
||||
# Phase 003: Vehicle CRUD And Detail Page
|
||||
|
||||
## Goal
|
||||
Build the main vehicle management interface.
|
||||
|
||||
## Work
|
||||
- Add `VehiclesController`.
|
||||
- Add routes for vehicle index, show, new, create, edit, update, and destroy.
|
||||
- Build simple ERB views for vehicle CRUD.
|
||||
- Make `vehicles#index` the root page.
|
||||
- On `vehicles#show`, display vehicle details, maintenance schedules, fuel history, and maintenance history.
|
||||
- Keep layout simple and mobile-friendly.
|
||||
|
||||
## Deliverables
|
||||
- Vehicle CRUD UI.
|
||||
- Vehicle request specs.
|
||||
- Basic navigation.
|
||||
|
||||
## Acceptance Criteria
|
||||
- Users can create, view, update, and delete vehicles.
|
||||
- Vehicle show page is the main operational screen.
|
||||
- Request specs cover successful and invalid create/update paths.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Phase 004: Fuel And Maintenance Event Entry
|
||||
|
||||
## Goal
|
||||
Allow users to record fuel and maintenance events from the vehicle detail page.
|
||||
|
||||
## Work
|
||||
- Add nested routes under vehicles for fuel entries and maintenance entries.
|
||||
- Add create forms on `vehicles#show`.
|
||||
- Save each fuel submission as a new `FuelEntry`.
|
||||
- Save each maintenance submission as a new `MaintenanceEntry`.
|
||||
- Update `Vehicle.current_odometer` when a fuel entry is created if the submitted odometer is newer.
|
||||
- Track `updated_by_user_id` on each event.
|
||||
- Add request specs and model specs for event creation.
|
||||
|
||||
## Deliverables
|
||||
- Fuel entry creation flow.
|
||||
- Maintenance entry creation flow.
|
||||
- Odometer update behavior.
|
||||
- Event history display on vehicle show page.
|
||||
|
||||
## Acceptance Criteria
|
||||
- Fuel submissions create records and update vehicle odometer.
|
||||
- Maintenance submissions create records.
|
||||
- Invalid submissions re-render or redirect with validation errors.
|
||||
- Every event records the submitting user.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Phase 005: Lightweight Internal Authentication
|
||||
|
||||
## Goal
|
||||
Implement simple internal identity tracking without passwords.
|
||||
|
||||
## Work
|
||||
- Add a monthly access key concept for initial identification.
|
||||
- Add a flow where a person enters/scans the current key, provides name/email, and receives a session.
|
||||
- Store only a session user id/token in the browser after verification.
|
||||
- Add `Current.user` or controller helper methods for accessing the active user.
|
||||
- Require an identified user before creating fuel or maintenance entries.
|
||||
- Keep admin/regular user roles out of scope for now.
|
||||
|
||||
## Deliverables
|
||||
- Login/identification page.
|
||||
- Session creation and clearing.
|
||||
- User creation or lookup by email.
|
||||
- Controller specs/request specs for authenticated and unauthenticated flows.
|
||||
|
||||
## Acceptance Criteria
|
||||
- Passwords are not used.
|
||||
- Raw QR/monthly key is not required on every request after session creation.
|
||||
- Fuel and maintenance submissions are attributed to the active user.
|
||||
- Unidentified users cannot submit entries.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Phase 006: Maintenance Schedules And Overdue Alerts
|
||||
|
||||
## Goal
|
||||
Use maintenance schedules and event history to show overdue maintenance status.
|
||||
|
||||
## Work
|
||||
- Add CRUD for vehicle maintenance schedules.
|
||||
- On `vehicles#show`, compare each schedule against maintenance history.
|
||||
- Mark a schedule overdue when either mileage interval or time interval is exceeded.
|
||||
- Use the matching maintenance entry description/type as the history key.
|
||||
- Log overdue notifications to Rails logger for now.
|
||||
- Keep external notification service integration stubbed and isolated.
|
||||
|
||||
## Deliverables
|
||||
- Maintenance schedule management.
|
||||
- Overdue calculation logic.
|
||||
- Vehicle show alerts.
|
||||
- Specs for mileage-based, time-based, and not-overdue cases.
|
||||
|
||||
## Acceptance Criteria
|
||||
- Vehicle show page displays overdue alerts.
|
||||
- Mileage and time intervals are treated as an OR condition.
|
||||
- Notification behavior is logged, not sent externally.
|
||||
- Overdue logic is covered by tests.
|
||||
Reference in New Issue
Block a user