mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Put counts into the notification filters
We can filter notifications on the activity page by state. This commit adds counts to those filters. This is mainly so that we can consistently do the same thing on the job page later on.
This commit is contained in:
@@ -48,3 +48,24 @@ def add_rates_to(delivery_statistics):
|
||||
),
|
||||
**delivery_statistics
|
||||
)
|
||||
|
||||
|
||||
def statistics_by_state(statistics):
|
||||
return {
|
||||
'sms': {
|
||||
'processed': statistics['sms_requested'],
|
||||
'sending': (
|
||||
statistics['sms_requested'] - statistics['sms_failed'] - statistics['sms_delivered']
|
||||
),
|
||||
'delivered': statistics['sms_delivered'],
|
||||
'failed': statistics['sms_failed']
|
||||
},
|
||||
'email': {
|
||||
'processed': statistics['emails_requested'],
|
||||
'sending': (
|
||||
statistics['emails_requested'] - statistics['emails_failed'] - statistics['emails_delivered']
|
||||
),
|
||||
'delivered': statistics['emails_delivered'],
|
||||
'failed': statistics['emails_failed']
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user