Commit Graph

13 Commits

Author SHA1 Message Date
Leo Hemsted
00e9fee471 make sure we combine stats that are already there
eg we have yesterdays data and want to top it up with todays deltas

'use a defaultdict to make this painless'
2018-07-03 14:58:32 +01:00
Leo Hemsted
1589bb58bb make sure test keys are filtered out of stats 2018-07-03 14:58:32 +01:00
Leo Hemsted
2463cd8fb5 move monthly notification stats from notification history to ft tables
it now uses the ft_notification_status table - nice and quick. if you
ask for the current tax year it'll top up the data with numbers from
the notification table.

the data is in exactly the same shape as the old endpoint - no changes
to the admin app are necessary
2018-07-03 14:56:31 +01:00
Katie Smith
7e6076a41f Add in new endpoint with data for platform admin stats
Added in a new endpoint and DAO function to provide the data for the new
platform admin statistics page. The DAO method gets different data from
the Notifications / NotificationHistory table and also groups it differently.

The old endpoint has not been deleted yet to allow the numbers on the
old and new pages to be compared.
2018-06-29 16:01:45 +01:00
Leo Hemsted
28d5f9b87f flake8 - remove unused imports and ensure they're always at the top of the file 2017-11-28 14:28:01 +00:00
Leo Hemsted
f577e91134 treat sent as delivered in detailed service api
this is for when we fetch the large blue numbers for viewing
notifications for an entire service
2017-04-28 11:56:12 +01:00
Imdad Ahad
36d52c6e42 Add template type to response and refactor 2017-03-08 12:01:38 +00:00
Imdad Ahad
8272a4388d Add dao method to get template stats per month in financial year for service 2017-03-08 12:01:38 +00:00
Chris Hill-Scott
cffd0c2c54 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
2017-02-08 13:16:41 +00:00
Leo Hemsted
3cd8605e11 fix api statistics to account for letters 2017-01-31 11:32:53 +00:00
Leo Hemsted
556b69a487 still return service if they have never sent any notifications 2016-08-24 15:00:51 +01:00
Leo Hemsted
e5b0d568fa ensure stats returned for lifespan of service
even if they've never sent a notification for realsies
2016-07-28 15:24:21 +01:00
Leo Hemsted
8ad47481d7 add GET /service/<id>/notifications/weekly
moved format_statistics to a new service/statistics.py file, and
refactored to share code. moved tests as well, to try and enforce
separation between the restful endpoints of rest.py and the logic/
data manipulation of statistics.py
2016-07-28 13:48:39 +01:00