Skip to content

feat: bulk csv template download#6423

Open
matzduniuk wants to merge 18 commits into
mainfrom
6381/bulk-csv-template-download
Open

feat: bulk csv template download#6423
matzduniuk wants to merge 18 commits into
mainfrom
6381/bulk-csv-template-download

Conversation

@matzduniuk

Copy link
Copy Markdown
Collaborator

This PR addresses #6381

  • Addresses the issue in full
  • Addresses only certain aspects of the issue

Description

  • Adds a new /applications/bulk-update/template/:listingId endpoint for downloading the template CSV file.
  • Adds a new ApplicationBulkUploadService service for handling the template CSV export
  • Adds integration test spec file for the new service methods

How Can This Be Tested/Reviewed?

  1. Make sure at least one listing has valid applications that have not been deleted or marked as duplicates
  2. Target the /applications/bulk-update/template/:listingId endpoint using the ID of the listing from step 1
  3. Analyse the generated template CSV file

Note

Alternatively, this ticket can be verified through the manual check and adjustments of the implemented integration tests

Author Checklist:

  • Added QA notes to the issue with applicable URLs
  • Reviewed in a desktop view
  • Reviewed in a mobile view
  • Reviewed considering accessibility
  • Added tests covering the changes
  • Made corresponding changes to the documentation
  • Ran yarn generate:client and/or created a migration when required

Review Process:

  • Read and understand the issue
  • Ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Either (1) explicitly ask a clarifying question, (2) request changes, or (3) approve the PR, even if there are very small remaining changes, if you don't need to re-review after the updates

@matzduniuk matzduniuk self-assigned this Jun 15, 2026
@matzduniuk matzduniuk added the 1 review needed Requires 1 more review before ready to merge label Jun 15, 2026
@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for partners-bloom-dev ready!

Name Link
🔨 Latest commit 0b006ee
🔍 Latest deploy log https://app.netlify.com/projects/partners-bloom-dev/deploys/6a340e10f146090009df28d9
😎 Deploy Preview https://deploy-preview-6423--partners-bloom-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-angelopolis ready!

Name Link
🔨 Latest commit 0b006ee
🔍 Latest deploy log https://app.netlify.com/projects/bloom-angelopolis/deploys/6a340e10f146090009df28de
😎 Deploy Preview https://deploy-preview-6423--bloom-angelopolis.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-public-seeds ready!

Name Link
🔨 Latest commit 0b006ee
🔍 Latest deploy log https://app.netlify.com/projects/bloom-public-seeds/deploys/6a340e10ad1e5800081e4265
😎 Deploy Preview https://deploy-preview-6423--bloom-public-seeds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-exygy-dev ready!

Name Link
🔨 Latest commit 0b006ee
🔍 Latest deploy log https://app.netlify.com/projects/bloom-exygy-dev/deploys/6a340e101499d70007f1878e
😎 Deploy Preview https://deploy-preview-6423--bloom-exygy-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds backend support for downloading a per-listing “bulk update” CSV template for applications, including a new API endpoint, service/module wiring, and unit tests.

Changes:

  • Added GET /applications/bulk-update/template/:listingId endpoint to download the bulk-update template.
  • Introduced ApplicationBulkUploadService + module to generate the template export.
  • Added unit tests covering template CSV generation helpers and authorization logic.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
shared-helpers/src/types/backend-swagger.ts Adds generated client method for the new template download endpoint.
api/test/unit/services/application-bulk-upload.service.spec.ts Adds unit tests for CSV template generation + authorization checks.
api/src/services/application-bulk-upload.service.ts New service implementing template CSV creation and download/authorization logic.
api/src/modules/application.module.ts Wires the new bulk-upload module into the application module.
api/src/modules/application-bulk-upload.module.ts New Nest module exporting ApplicationBulkUploadService.
api/src/controllers/application.controller.ts Adds the new template download route and connects it to the service.

Comment thread api/src/services/application-bulk-upload.service.ts
Comment thread api/src/services/application-bulk-upload.service.ts Outdated
Comment thread api/src/services/application-bulk-upload.service.ts
Comment thread api/src/services/application-bulk-upload.service.ts
Comment thread api/src/services/application-bulk-upload.service.ts Outdated
Comment thread api/src/controllers/application.controller.ts
Comment thread api/src/controllers/application.controller.ts
Comment thread shared-helpers/src/types/backend-swagger.ts
Comment thread api/test/unit/services/application-bulk-upload.service.spec.ts Outdated
Comment on lines +106 to +117
beforeEach(() => {
writeStream = fs.createWriteStream('sampleTemplate.csv');
jest.spyOn(fs, 'createWriteStream').mockReturnValue(writeStream);
});

afterEach(() => {
writeStream.end();
if (fs.existsSync('sampleTemplate.csv')) {
fs.unlinkSync('sampleTemplate.csv');
}
jest.restoreAllMocks();
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Technically true but very low prio

@emilyjablonski

Copy link
Copy Markdown
Collaborator

@matzduniuk So sorry I might not actually have time to review Copilot's review before tomorrow morning! So some of the comments may be silly 🤪

@emilyjablonski emilyjablonski changed the title 6381/bulk csv template download feat: bulk csv template download Jun 18, 2026
Comment thread api/src/services/application-bulk-upload.service.ts
Comment thread api/src/services/application-bulk-upload.service.ts
@matzduniuk matzduniuk added needs changes The author must make changes and then re-request review before merging and removed 1 review needed Requires 1 more review before ready to merge labels Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs changes The author must make changes and then re-request review before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants