brandonleon/VehicleVitals

Title: Update Odometer Reading in Vehicles Table When Recording Service or Fill-Up

Closed this issue · 1 comments

The application currently stores static mileage values in the "vehicles" table and requires the implementation of a feature that updates the "mileage" field whenever a new service or fill-up is recorded. This update is essential to maintain accurate mileage records for each vehicle in the system.

Proposed Solution:

It is suggested to implement a mechanism that updates the "mileage" field in the "vehicles" table whenever a new service or fill-up log entry is recorded. The new mileage value can be obtained from the log entry, and the corresponding vehicle's "mileage" field should be updated accordingly. This ensures that the mileage in the "vehicles" table accurately reflects the latest data.

Additional Considerations:

This feature will require updating the application logic to retrieve the latest mileage value from the log entry and apply it to the respective vehicle's "mileage" field in the "vehicles" table.
It is essential to handle cases where multiple log entries are recorded for the same vehicle, ensuring that the "mileage" field is updated accurately with the most recent value.

Acceptance Criteria:

When a new service or fill-up log entry is recorded, the "mileage" field in the corresponding vehicle's record in the "vehicles" table is updated with the latest odometer reading.

Fixed in 5b9ba8c