Add a page to show delivery rates week-by-week

Implements
https://github.com/alphagov/notifications-api/pull/286

Will always show weeks as Monday to Sunday.
This commit is contained in:
Chris Hill-Scott
2016-05-03 13:25:22 +01:00
parent afc8fb08f3
commit 50427ecd3f
13 changed files with 170 additions and 35 deletions

View File

@@ -20,3 +20,14 @@ class StatisticsApiClient(BaseAPIClient):
url='/service/{}/notifications-statistics'.format(service_id),
params=params
)
def get_7_day_aggregate_for_service(self, service_id, date_from=None, week_count=None):
params = {}
if date_from is not None:
params['date_from'] = date_from
if week_count is not None:
params['week_count'] = week_count
return self.get(
url='/service/{}/notifications-statistics/seven_day_aggregate'.format(service_id),
params=params
)