Remove weekly stats endpoints

The weekly stats endpoint wont be used once
https://github.com/alphagov/notifications-admin/pull/1109 has been
merged.

It has been replaced with a new monthly endpoint in
https://github.com/alphagov/notifications-api/pull/807
This commit is contained in:
Chris Hill-Scott
2017-02-08 13:16:41 +00:00
parent 8cefe6a71b
commit cffd0c2c54
6 changed files with 2 additions and 237 deletions

View File

@@ -224,25 +224,6 @@ def _stats_for_service_query(service_id):
)
@statsd(namespace="dao")
def dao_fetch_weekly_historical_stats_for_service(service_id):
monday_of_notification_week = func.date_trunc('week', NotificationHistory.created_at).label('week_start')
return db.session.query(
NotificationHistory.notification_type,
NotificationHistory.status,
monday_of_notification_week,
func.count(NotificationHistory.id).label('count')
).filter(
NotificationHistory.service_id == service_id
).group_by(
NotificationHistory.notification_type,
NotificationHistory.status,
monday_of_notification_week
).order_by(
asc(monday_of_notification_week), NotificationHistory.status
).all()
@statsd(namespace="dao")
def dao_fetch_monthly_historical_stats_for_service(service_id, year):
monday_of_notification_week = func.date_trunc('week', NotificationHistory.created_at).label('week_start')