Skip to content

GLSD-20910: Create endpoint to get top level file detail from eacd-file-processor for a given file reference#29

Open
finlaypugh07 wants to merge 25 commits into
mainfrom
GLSD-20910-2
Open

GLSD-20910: Create endpoint to get top level file detail from eacd-file-processor for a given file reference#29
finlaypugh07 wants to merge 25 commits into
mainfrom
GLSD-20910-2

Conversation

@finlaypugh07

Copy link
Copy Markdown
Contributor

Acceptance Criteria
A 'GET /file-detail/:reference' endpoint is created in the new support-routes file (created in GLSD-20951) on the new eacd-file-processor service (built in GLSD-19170) that returns the following fields for the record from the file collection that matches the given file reference:
fileName
reference
creationDateTime
errorCode
errorMessage
fileStatus
lastUpdatedDateTime
requestorEmail
requestorPID
requestorName
downloadUrl
fileMimeType
uploadTimestamp
checksum
size
failureReason
failureMessage
approverEmail
approverPID
approverName
approvalDateTime
totalEntryCount
totalSuccessCount
totalFailureCount
Internal auth is implemented on this new endpoint and configured such that only emac-support-frontend can call it
The following response status codes are implemented:
Http Code Description Error Code Error Message
200 Success A record was found and returned
204 No Content No record found for the requested reference
Relevant tests are implemented for the new functionality

@platops-pr-bot

Copy link
Copy Markdown
  • You have multiple routes files conf/support.routes, conf/testOnlyDoNotUseInAppConf.routes using the same package uk.gov.hmrc.eacdfileprocessor.testOnly.controllers, which leads to collision with the reverse routes. Please ensure each routes file refers to a different package.
  • uk.gov.hmrc.objectstore:object-store-client-play-30 can be updated to 2.6.0 in project/AppDependencies.scala.

Comment thread conf/support.routes Outdated
Comment thread app/uk/gov/hmrc/eacdfileprocessor/models/Details.scala
Comment thread app/uk/gov/hmrc/eacdfileprocessor/services/FileDetailService.scala Outdated
Comment thread conf/support.routes Outdated
Comment thread app/uk/gov/hmrc/eacdfileprocessor/testOnly/controllers/TestController.scala Outdated
@platops-pr-bot

Copy link
Copy Markdown
  • You have multiple routes files conf/support.routes, conf/testOnlyDoNotUseInAppConf.routes using the same package uk.gov.hmrc.eacdfileprocessor.testOnly.controllers, which leads to collision with the reverse routes. Please ensure each routes file refers to a different package.
  • uk.gov.hmrc.objectstore:object-store-client-play-30 can be updated to 2.6.0 in project/AppDependencies.scala.

@platops-pr-bot

Copy link
Copy Markdown
  • You have multiple routes files conf/support.routes, conf/testOnlyDoNotUseInAppConf.routes using the same package uk.gov.hmrc.eacdfileprocessor.testOnly.controllers, which leads to collision with the reverse routes. Please ensure each routes file refers to a different package.
  • uk.gov.hmrc.objectstore:object-store-client-play-30 can be updated to 2.6.0 in project/AppDependencies.scala.

Comment thread app/uk/gov/hmrc/eacdfileprocessor/support/controllers/FileDetailsController.scala Outdated
Comment thread app/uk/gov/hmrc/eacdfileprocessor/support/controllers/FileDetailsController.scala Outdated

import java.time.Instant

class FileDetailsControllerISpec extends IntegrationSpec with TestData with DefaultAwaitTimeout {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we likely want to add a test in this file for the exact format the Json is being returned in. checking this we're currently seeing something like

{
  "_id" : {
    "$oid" : "6994a038d540b44c4403aee5"
  },
  "reference" : {
    "value" : "08aad019-7f66-4456-8d52-93f12109876f"
  },
  "status" : "failed",
  "requestorPID" : "12345678",
  "requestorEmail" : "test@hmrc.gov.uk",
  "requestorName" : "Test User",
  "details" : {
    "failureReason" : "REJECTED",
    "message" : "MIME type application/pdf is not allowed for service"
  },
  "creationDateTime" : {
    "$date" : {
      "$numberLong" : "1771418638342"
    }
  }
}

Where we want to see something like:

{
  "id" : "6994a038d540b44c4403aee4",
  "reference" : "test-ref-789",
  "status" : "approved",
  "requestorPID" : "12345678",
  "requestorEmail" : "test@hmrc.gov.uk",
  "requestorName" : "Test User",
  "details" : {
    "name" : "bulk-de-enrol.csv",
    "mimeType" : "text/csv",
    "downloadUrl" : "http://localhost:9570/upscan/download/c5da3bd6-f118-4cde-afff-93f763bf6448",
    "size" : 32270,
    "checksum" : "a0acaa6039c1a94c6f5c43f144c5add07de9381f98701cb14c7c6ce2be18020b"
  },
  "approverDetails" : {
    "approverEmail" : "approverTest@hmrc.gov.uk",
    "approverPID" : "12345678",
    "approverName" : "Approver1",
    "errorCode" : "error code",
    "errorMessage" : "error message"
  },
  "totalEntryCount" : 100,
  "uploadedDateTime" : null,
  "lastUpdatedDateTime" : null,
  "approvedAtDateTime" : "2026-02-18T12:43:58.342Z",
  "creationDateTime" : "2026-02-18T12:43:58.342Z",
  "totalFailureCount" : 5,
  "totalSuccessCount" : 95
}

So that the ID, dates etc. are in a more appropriate format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants