mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Added joins to template, job and user for returned letter query.
Added unit tests Comleted endpoint to get returned letter details
This commit is contained in:
@@ -60,7 +60,6 @@ from app.models import (
|
||||
LetterBranding,
|
||||
Domain,
|
||||
NotificationHistory,
|
||||
NOTIFICATION_RETURNED_LETTER,
|
||||
ReturnedLetter
|
||||
)
|
||||
|
||||
@@ -944,15 +943,13 @@ def set_up_usage_data(start_date):
|
||||
return org, org_3, service, service_3, service_4, service_sms_only
|
||||
|
||||
|
||||
def create_returned_letter(service=None, reported_at=None):
|
||||
def create_returned_letter(service=None, reported_at=None, notification_id=None):
|
||||
if not service:
|
||||
service = create_service(service_name='a - with sms and letter')
|
||||
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,
|
||||
notification_id=notification_id or uuid.uuid4(),
|
||||
created_at=datetime.utcnow(),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user