-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate the distance for a task into a tasklist even when no vehicle is set #4805
base: master
Are you sure you want to change the base?
Conversation
3f71483
to
c39304f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you plan to use distance and CO2 emissions?
I'm not sure that putting them into a Task entity is a good idea. It seems to me that distanceFromPrevious
, at least, belongs more to a TaskCollectionItem
, as it depends on the position of a Task in a list and should be managed together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering about that as well.
At the time I put it on Task directly, as we are for real interested only on the last value: a task may be assigned several days in a row, but actually only the last assignment if several make sense (when we accomplish the task for real). so in reality there is only one value we are interested into.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also coopcycle/coopcycle#166 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are for real interested only on the last value
Then it seems a waste of time to recalculate all these values all the time. Maybe subscribe to a task:done event and calculate them only then? (I'd also rename the fields in that case to something in the past like traveled_distance
, co2_consumed
)
Issue here coopcycle/coopcycle#167 |
No description provided.