add detailed flag to GET service api client

returns current (past 7 days) notification stats as well as service info
This commit is contained in:
Leo Hemsted
2016-07-19 13:53:27 +01:00
parent d9944107da
commit 4451a8634d
5 changed files with 39 additions and 16 deletions

View File

@@ -154,9 +154,7 @@ def get_dashboard_partials(service_id):
return {
'totals': render_template(
'views/dashboard/_totals.html',
statistics=add_rates_to(sum_of_statistics(
statistics_api_client.get_statistics_for_service(service_id, limit_days=7)['data']
))
statistics=get_dashboard_totals(service_id)
),
'template-statistics': render_template(
'views/dashboard/template-statistics.html',
@@ -178,6 +176,12 @@ def get_dashboard_partials(service_id):
}
def get_dashboard_totals(service_id):
return add_rates_to(sum_of_statistics(
statistics_api_client.get_statistics_for_service(service_id, limit_days=7)['data']
))
def calculate_usage(usage):
# TODO: Don't hardcode these - get em from the API
sms_free_allowance = 250000