Updated the uploads page to include letters. Now the page shows uploaded letters plus jobs.

New units tests have not been written for this page because it is very like this will be refactor and probably a new template created for the page. Some design needs to go into this page.
But we needed something ready for user research.
This commit is contained in:
Rebecca Law
2019-12-05 16:14:30 +00:00
parent cb7d0e3813
commit 833a5cad8f
3 changed files with 44 additions and 4 deletions

View File

@@ -61,6 +61,20 @@ class JobApiClient(NotifyAdminAPIClient):
return jobs
def get_uploads(self, service_id, limit_days=None, page=1):
params = {'page': page}
if limit_days is not None:
params['limit_days'] = limit_days
uploads = self.get(url='/service/{}/upload'.format(service_id), params=params)
for upload in uploads['data']:
stats = self.__convert_statistics(upload)
upload['notifications_sent'] = stats['delivered'] + stats['failed']
upload['notifications_delivered'] = stats['delivered']
upload['notifications_failed'] = stats['failed']
upload['notifications_requested'] = stats['requested']
return uploads
def has_sent_previously(self, service_id, template_id, template_version, original_file_name):
return (
template_id, template_version, original_file_name