Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.
This repository was archived by the owner on May 23, 2025. It is now read-only.

FFE - Front-end and web-server changes #3908

@as1729

Description

@as1729

Story: #3803

Requirements

  • Add a button to the front-end that allows users to kick-off Full File export
  • Add a route on the backend that handles adding values to an SQS queue.
  • Add a route on the backend that handles getting a signed-URL for the full-file export .zip file from S3.

Front-end changes

Back-end webserver changes

  • Goal: There are two backend endpoints available to support users.
    • When the user clicks the button on the front-end there has to be an endpoint in the backend to support kicking off a SQS task.
    • When the SQS task is completed, it will kick-off an email which contains a second button for the user to retrieve their zip-file. This endpoint on the backend is responsible for generating an S3 signedUrl and giving that to the front-end to begin file-download.
      These endpoints will be defined in arpa_reporter/routes/uploads.js: https://github.com/usdigitalresponse/usdr-gost/blob/main/packages/server/src/arpa_reporter/routes/uploads.js

Endpoint 1 to add

Endpoint 2 to add

  • GET /api/uploads/:tenantId/getFullFileExport
    This endpoint is what will be emailed to users once the final zip-file is ready and uploaded to S3. When users click on the endpoint (assuming they are authenticated), their browser should immediately make a signed request to S3 and download the zip-file as well as the latest metadata CSV file.
    S3 bucket is: process.env.AUDIT_REPORT_BUCKET
    S3 Keys are:
    • fullFileExport/${user.tenant_id}/archive.zip
    • fullFileExport/${user.tenant_id}/archive_metadata.csv
    • Note: when downloading the zipfile and the metadata please use the ResponseContentDisposition and ensure that the names are updated to FullFileExport-MM.DD.YYY.HH.SS.zip and MetadataFullFileExport-MM.DD.YYYY.HH.SS.zip in 24 hr time format. The time is the time as of when the user visited this link.

This endpoint will model similarly to the endpoint defined here: https://github.com/usdigitalresponse/usdr-gost/blob/main/packages/server/src/arpa_reporter/routes/exports.js#L14-L48

Metadata

Metadata

Type

No type

Projects

Status

🚢 Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions