Commit Graph

31 Commits

Author SHA1 Message Date
Cliff Hill
dcf7885365 Only 6 fails left to go.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:20 -05:00
Cliff Hill
cd081ef163 Down to 11 errors left to fix for tests.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:44:19 -05:00
Cliff Hill
9523cc1d97 Cleaning up with black, isort, flake8.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:33 -05:00
Cliff Hill
69a9accfca Getting NotificationStatus implemented everywhere.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:32 -05:00
Cliff Hill
985ad27b3e Getting imports right to use app.enums
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:32 -05:00
Cliff Hill
908d695b54 More cleanup.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:31 -05:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Kenneth Kehl
08c1ad75c8 notify-260 remove server-side timezone handling 2023-05-10 08:39:50 -07:00
stvnrlly
b50cb4712f tz utility swap and many test updates 2022-11-10 12:33:25 -05:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Leo Hemsted
7ecd7341b0 add broadcast to template_types and add broadcast_data
had to go through the code and change a few places where we filter on
template types. i specifically didn't worry about jobs or notifications.

Also, add braodcast_data - a json column that might contain arbitrary
broadcast data that we'll figure out as we go. We don't know what it'll
look like, but it should be returned by the API
2020-07-06 15:47:13 +01:00
Pea Tyczynska
bd5126481c Remove cancelled from requested statuses in service statistics 2019-01-11 14:27:54 +00:00
Pea (Malgorzata Tyczynska)
c5e5c86982 Merge pull request #2290 from alphagov/its_not_a_failure_to_cancel
Cancelled notifications don't show as failures in statistics
2019-01-10 15:09:30 +00:00
Leo Hemsted
3e21f57481 fix platform admin stats row-order bug
now that we're reading from two tables (ft_notification_status and
notifications) for stats, we'll get a couple of rows for each
notification type. If a service doesn't have any rows in one of those
tables, the query will return a row with nulls for the notification
types and counts. Some services will have history but no stats from
today, others will have data from today but no history.

This commit acknowledges that any row might have nulls, not just the
first row.
2019-01-09 11:43:40 +00:00
Pea Tyczynska
e3a79e80c9 Cancelled notifications don't show as failures in statistics 2019-01-08 17:50:34 +00:00
Katie Smith
90d9135fcf Return cancelled letters for dashboard
Added cancelled letters to the number of failed letters in the statistics
that get used for the dashboard. At some point, we want to stop
including cancelled letters in the stats, but for now this keeps things
consistent with our current letter failure state, permanent-failure.
2018-12-03 17:51:09 +00:00
Katie Smith
ff06d120e8 Bump notifications-utils to 3.7.0
Bumped notifications-utils to 3.7.0. Version 3.7.0 includes the
`convert_utc_to_bst` and `convert_bst_to_utc` functions and the
`LETTER_PROCESSING_DEADLINE` constant, so these have been removed from
this repo and anywhere using these has now been updated to get these
from `notifications-utils`.

Also bumped pytest by a patch version to bring in a bug fix.
2018-11-26 12:53:39 +00:00
Rebecca Law
80d02c434b Add validation-failed and virus-scan-failed in the failed counts for stats 2018-10-29 16:57:06 +00:00
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