From ce77ce8f2b559765f3efd2b5ae92cfbfa81f3a37 Mon Sep 17 00:00:00 2001 From: Scott Goodwin <33629936+scott-goodwin@users.noreply.github.com> Date: Thu, 9 Feb 2023 10:35:02 +0000 Subject: [PATCH] DL-IdFix - Added id to error scenrio --- app/v1/controllers/SubmitReturnController.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/v1/controllers/SubmitReturnController.scala b/app/v1/controllers/SubmitReturnController.scala index 8ac9c6da..a966ad0b 100644 --- a/app/v1/controllers/SubmitReturnController.scala +++ b/app/v1/controllers/SubmitReturnController.scala @@ -88,14 +88,16 @@ class SubmitReturnController @Inject()(val authService: EnrolmentsAuthService, Created(Json.toJson(serviceResponse.responseData)) .withApiHeaders(serviceResponse.correlationId, - "Receipt-ID" -> nrsId, + "Receipt-ID" -> correlationId, "Receipt-Timestamp" -> submissionTimestamp.format(DateUtils.isoInstantDatePattern), "Receipt-Signature" -> NrsResponse.deprecatedString) } result.leftMap { errorWrapper => val resCorrelationId: String = errorWrapper.correlationId - val leftResult = errorResult(errorWrapper).withApiHeaders(resCorrelationId) + val leftResult = errorResult(errorWrapper).withApiHeaders( + resCorrelationId, + "Receipt-ID" -> correlationId) warnLog(ControllerError(endpointLogContext ,vrn, request, leftResult.header.status, errorWrapper.error.message, resCorrelationId)) auditService.auditEvent(AuditEvents.auditSubmit(resCorrelationId,