Gerben321 / bike-care-tracker

Issue/Suggestion tracker for Bike Care app
3 stars 0 forks source link

Add constraints to service log data #69

Closed Gerben321 closed 1 month ago

Gerben321 commented 1 month ago

This is a feature that will enforce correct data for service logs. This is handy for me for further features and to ensure that the last service log is the one with the highest moving time or distance entered.

The 'problem' right now is that there are no checks for service logs. This mean that you can enter 100km for a service log on 25-03-2024. But you can enter 50km on 26-03-2024. This is a problem, because the application needs to know which service log is the last one because it calculates the progress of the service schedule based on the last log.

With these constraints I will be confident that the last one is really the last one.

The rules will be a combination of the entered date and the entered distance/moving time.

So for example you create your first service log on 25-03-2024 with distance 100km. Then you create another service log for 26-03-2024 with 50km. Bike Care wil then give an error, because the entered distance cannot be lower because it 's later in time. This will either force you to change the date to one before the one of 25-03-2024, OR to increase the distance to >50km for the given date.

This will not only enforce proper data for me, but only for the user, because if you make a little mistake in either the date or entered moving time/distance you will not notice and perhaps get a problem later on with wrong data from schedules. This will now let you know next time you create or edit a service log about an error.

Gerben321 commented 1 month ago

Will be deployed in version 2024.3.7.