mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Filter and navigate usage by financial year
Right now we tell people that the usage page is for the current financial year. This is a lie – it’s for all time. So this commit calls through to the API to get the stats for (by default) the current financial year. We already do this for the monthly breakdown, this just does the same thing for the yearly totals. It also adds navigation to show the data for other financial years: - previous so you can go back and see your usage and verify that the bill you’re about to pay is correct - next so that you can check what your SMS allowance is going to be before you actually get into it
This commit is contained in:
@@ -213,8 +213,11 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
def get_service_history(self, service_id):
|
||||
return self.get('/service/{0}/history'.format(service_id))
|
||||
|
||||
def get_service_usage(self, service_id):
|
||||
return self.get('/service/{0}/fragment/aggregate_statistics'.format(service_id))
|
||||
def get_service_usage(self, service_id, year=None):
|
||||
return self.get(
|
||||
'/service/{0}/fragment/aggregate_statistics'.format(service_id),
|
||||
params=dict(year=year)
|
||||
)
|
||||
|
||||
def get_weekly_notification_stats(self, service_id):
|
||||
return self.get(url='/service/{}/notifications/weekly'.format(service_id))
|
||||
|
||||
Reference in New Issue
Block a user