Add query string parameter to search by recipient

> Service teams that use the admin interface often need to know the
> outcome of a message... at the moment they have to page through all
> the results in the activity stream. They should be able to find
> notifications by email address or phone number.

– https://www.pivotaltracker.com/n/projects/1443052

This commit adds an additional query string parameter (`to`) to the URL,
which users can use to filter down the list of notifications.

It:
- takes the status into account
- doesn’t update the counts based on the search term (in reality each
  service will only send a handful of notifications to one person in any
  7 day period)

In other words the funnel that filters down the notifications looks
like:

> all notifications for service → only failed → only to this phone
> number
This commit is contained in:
Chris Hill-Scott
2017-05-30 12:55:13 +01:00
parent d516f19a33
commit f41830e5d3
5 changed files with 30 additions and 7 deletions

View File

@@ -21,7 +21,8 @@ class NotificationApiClient(NotifyAdminAPIClient):
limit_days=None,
include_jobs=None,
include_from_test_key=None,
format_for_csv=None
format_for_csv=None,
to=None,
):
params = {}
if page is not None:
@@ -38,6 +39,8 @@ class NotificationApiClient(NotifyAdminAPIClient):
params['include_from_test_key'] = include_from_test_key
if format_for_csv is not None:
params['format_for_csv'] = format_for_csv
if to is not None:
params['to'] = to
if job_id:
return self.get(
url='/service/{}/job/{}/notifications'.format(service_id, job_id),