diff --git a/projects/pre-sentence-reports-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/document/DocumentService.kt b/projects/pre-sentence-reports-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/document/DocumentService.kt index 20a4d95550..f16a165c78 100644 --- a/projects/pre-sentence-reports-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/document/DocumentService.kt +++ b/projects/pre-sentence-reports-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/document/DocumentService.kt @@ -47,14 +47,15 @@ class DocumentService( throw ConflictException("Court report ${courtReport.id} not for ${hmppsEvent.personReference.findCrn()}") } + document.name = document.name.replace(Regex("\\.doc$"), ".pdf") + document.lastSaved = ZonedDateTime.now() + document.lastUpdatedUserId = ServiceContext.servicePrincipal()!!.userId + alfrescoClient.releaseDocument(document.alfrescoId) alfrescoClient.updateDocument( document.alfrescoId, populateBodyValues(hmppsEvent, document, file) ) - - document.lastSaved = ZonedDateTime.now() - document.lastUpdatedUserId = ServiceContext.servicePrincipal()!!.userId } private fun populateBodyValues(