Skip to content
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

Fix: sort tasks by neighbourhoods. #343

Merged
merged 3 commits into from
Apr 27, 2024
Merged

Fix: sort tasks by neighbourhoods. #343

merged 3 commits into from
Apr 27, 2024

Conversation

teesloane
Copy link
Contributor

While pairing with @chadmohr he mentioned that we might want to consider grouping tasks by neighbourhood — sometimes tasks are all going to the same building / is useful for riders who can/want to take multiple deliveries to the same location.

Before

CleanShot 2024-04-26 at 11 26 08@2x

After

CleanShot 2024-04-26 at 11 25 12@2x

Comment on lines 462 to 463
Repo.preload(all_tasks, assigned_rider: fn _ -> all_riders end)
|> Enum.sort_by(fn t -> t.dropoff_location.neighborhood.name end)
Copy link
Contributor Author

@teesloane teesloane Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mveytsman tried to figure out how to do this at the DB level for too long and gave up. Happy to 🍐 if you know a better solution.

Copy link
Member

@mveytsman mveytsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@teesloane teesloane merged commit a04f6e5 into main Apr 27, 2024
1 check passed
@teesloane teesloane deleted the ty-chad/341 branch April 27, 2024 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants