You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Add a button that is only visible if isAdmin is true and enableFullFileExport feature flag is true in the HomeView.vue file. The button text should say “Send Full File Export by Email”.
The front-end should create a GET request to /api/uploads/exportAll
If the response is a 200 then show an alert: “Sent. Please note, it could take up to 1 hour for this email to arrive.”
Else if the response is not a 200 then show an alert: Display: “Something went wrong. Unable to send an email containing the treasury report. Reach out to [email protected] if this happens again.”
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
GET /api/uploads/exportAll
This endpoint is responsible for calling the code added in ticket FFE - JS task to query DB for directory structure and queue the Python task #3910 . The module will need to be imported from arpa_reporter/services/arpaExporter.js and will look for the following arguments: 1) the user's email 2) user's organization Id
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:
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.
Story: #3803
Requirements
Front-end changes
isAdmin
is true andenableFullFileExport
feature flag istrue
in theHomeView.vue
file. The button text should say “Send Full File Export by Email”./api/uploads/exportAll
alert
: “Sent. Please note, it could take up to 1 hour for this email to arrive.”alert
: Display: “Something went wrong. Unable to send an email containing the treasury report. Reach out to [email protected] if this happens again.”Back-end webserver changes
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
This endpoint is responsible for calling the code added in ticket FFE - JS task to query DB for directory structure and queue the Python task #3910 . The module will need to be imported from
arpa_reporter/services/arpaExporter.js
and will look for the following arguments: 1) the user's email 2) user's organization IdEndpoint 2 to add
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
ResponseContentDisposition
and ensure that the names are updated toFullFileExport-MM.DD.YYY.HH.SS.zip
andMetadataFullFileExport-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
The text was updated successfully, but these errors were encountered: