feat: bulk csv template download#6423
Conversation
…ications controller
✅ Deploy Preview for partners-bloom-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for bloom-angelopolis ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for bloom-public-seeds ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for bloom-exygy-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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/:listingIdendpoint 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. |
| 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(); | ||
| }); |
There was a problem hiding this comment.
Technically true but very low prio
|
@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 🤪 |
…bloom-housing/bloom into 6381/bulk-csv-template-download
This PR addresses #6381
Description
/applications/bulk-update/template/:listingIdendpoint for downloading the template CSV file.ApplicationBulkUploadServiceservice for handling the template CSV exportHow Can This Be Tested/Reviewed?
/applications/bulk-update/template/:listingIdendpoint using the ID of the listing from step 1Note
Alternatively, this ticket can be verified through the manual check and adjustments of the implemented integration tests
Author Checklist:
yarn generate:clientand/or created a migration when requiredReview Process: