Skip to content

Create Endpoint for Exporting Donation Data to CSV #44

@aaronashby

Description

@aaronashby

Overview

We want to set up an endpoint that allows us to export donation information to a CSV format.

Tasks

  • Add GET /donations/export route in donations.controller.ts, ensuring that only admins can access that route.
    • If a non-admin tries to access the route, throw an UnauthorizedException
  • Add a corresponding exportToCsv method in donations.service.ts. This function should generate a CSV file with columns for a donation's ID, first and last name, email, amount, type, interval (if recurring), date, and transaction ID
  • Write unit tests to ensure that files are formatted correctly, and edge cases (e.g. no donations to format) are properly handled

Acceptance Criteria

  • The controller should call the method in the service to export the donations in CSV format
  • Only admins should be able to successfully call the route
  • All unit tests pass

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions