Return recipient for letter uploads

If your caseworking system always spits out files with the same name it
will be hard to differentiate them when looking at the uploads page.

Seeing who the letter was sent to will help you differentiate them.

We can’t do this until the API returns the recipient.
This commit is contained in:
Chris Hill-Scott
2020-02-27 13:19:51 +00:00
parent 0ac9a035d5
commit c7895df82c
4 changed files with 18 additions and 5 deletions

View File

@@ -30,7 +30,8 @@ def dao_get_uploads_by_service_id(service_id, limit_days=None, page=1, page_size
Job.scheduled_for.label("scheduled_for"),
Job.processing_started.label('processing_started'),
Job.job_status.label("status"),
literal('job').label('upload_type')
literal('job').label('upload_type'),
literal(None).label('recipient'),
).join(
Template, Job.template_id == Template.id
).filter(
@@ -58,7 +59,8 @@ def dao_get_uploads_by_service_id(service_id, limit_days=None, page=1, page_size
# letters don't have a processing_started date but we want created_at to be used for sorting
Notification.created_at.label('processing_started'),
Notification.status,
literal('letter').label('upload_type')
literal('letter').label('upload_type'),
Notification.to.label('recipient'),
).join(
Template, Notification.template_id == Template.id
).filter(