AM-1134 waste: manual notification by route name - #235
Open
fhaver-amsterdam wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support in the waste service for sending manual push notifications to a subset of users selected by waste collection route name, by introducing route selection on ManualNotification and resolving recipients via the Waste Guide API + bag IDs. This extends existing manual notification functionality while keeping the default behavior (“send to all”) when no routes are selected.
Changes:
- Add
affected_routesselection toManualNotificationand expose it in the Django admin UI + confirmation template. - Update
ManualNotificationServiceto resolve device IDs via route name → bag IDs (Waste Guide API) → device IDs. - Add/extend tests for route-scoped manual notifications and bag-id/device-id lookup.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| waste/services/notification.py | Implements route-filtered recipient lookup for manual notifications via Waste Guide pagination. |
| waste/models.py | Adds affected_routes M2M on ManualNotification and ensures route-name model is available for selection. |
| waste/migrations/0010_manualnotification_affected_routes.py | Adds migration for the new affected_routes field. |
| waste/admin/notification_admin.py | Enables route selection in admin and displays selected routes on the confirmation screen. |
| core/templates/admin/notification_confirm_send.html | Renders the selected route list in the confirmation template. |
| core/services/waste_device.py | Adds lookup helper get_device_ids_for_bag_ids. |
| core/tests/services/test_waste_device.py | Tests the new waste-device lookup helper and ensures device creation behavior. |
| waste/tests/services/test_notification.py | Adds coverage for route-scoped manual notifications and bag-id pagination behavior. |
| requirements.txt | Updates pinned dependencies export. |
| uv.lock | Updates lockfile with newer dependency versions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+51
to
+53
| class ManualNotificationService( | ||
| AbstractNotificationService, WasteCollectionAbstractService | ||
| ): |
Comment on lines
+83
to
89
| device_ids = notification_service.get_device_ids(obj) | ||
| context = { | ||
| **self.admin_site.each_context(request), | ||
| "nr_sessions": len(device_ids), | ||
| "notification": obj, | ||
| "affected_routes": self.affected_routes_display(obj), | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Affected services
Definition of done
make openapi-diff)make dev)make requirements)- [ ] Infrastructure config updated (aapp_azure_infra)- [ ] Loadtests for relevant endpoints (aapp_testing_loadtests)After PR created (and deployed on dev):
Other notes
GitHub Copilot was used in writing the code