Add endpoint to return the summary data for returned letters.

Returning the count of letters that are returned for each report date.
This commit is contained in:
Rebecca Law
2019-12-10 16:21:55 +00:00
parent 40a0c62926
commit c8364b4dc4
5 changed files with 15 additions and 8 deletions

View File

@@ -950,11 +950,11 @@ def create_returned_letter(service, reported_at=None):
template = create_template(service=service, template_type=LETTER_TYPE)
notification = create_notification(template=template, status=NOTIFICATION_RETURNED_LETTER)
returned_letter = ReturnedLetter(
service_id= service.id,
reported_at= reported_at or datetime.utcnow(),
notification_id= notification.id
service_id=service.id,
reported_at=reported_at or datetime.utcnow(),
notification_id=notification.id
)
db.session.add(returned_letter)
db.session.commit()
return returned_letter
return returned_letter