mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Re-add a 'requested' stat to a job
It’s useful to know how many notifications we’ve handed off to our providers. This is a measure of how complete the processing of the job is. This is important, because once the job processing is complete then you can accurately reconcile the report with the CSV file that you’ve uploaded.
This commit is contained in:
@@ -19,7 +19,8 @@ class JobApiClient(BaseAPIClient):
|
||||
results = {
|
||||
'sending': 0,
|
||||
'delivered': 0,
|
||||
'failed': 0
|
||||
'failed': 0,
|
||||
'requested': 0
|
||||
}
|
||||
if 'statistics' in job:
|
||||
for outcome in job['statistics']:
|
||||
@@ -29,6 +30,7 @@ class JobApiClient(BaseAPIClient):
|
||||
results['sending'] += outcome['count']
|
||||
if outcome['status'] in ['delivered']:
|
||||
results['delivered'] += outcome['count']
|
||||
results['requested'] += outcome['count']
|
||||
return results
|
||||
|
||||
def get_job(self, service_id, job_id=None, limit_days=None, status=None):
|
||||
@@ -42,6 +44,7 @@ class JobApiClient(BaseAPIClient):
|
||||
job['data']['notifications_sent'] = stats['delivered'] + stats['failed']
|
||||
job['data']['notifications_delivered'] = stats['delivered']
|
||||
job['data']['notifications_failed'] = stats['failed']
|
||||
job['data']['notifications_requested'] = stats['requested']
|
||||
return job
|
||||
|
||||
params = {}
|
||||
@@ -55,6 +58,7 @@ class JobApiClient(BaseAPIClient):
|
||||
job['notifications_sent'] = stats['delivered'] + stats['failed']
|
||||
job['notifications_delivered'] = stats['delivered']
|
||||
job['notifications_failed'] = stats['failed']
|
||||
job['notifications_requested'] = stats['requested']
|
||||
|
||||
return jobs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user