Skip to content

[Backend] — Prediction History CSV Export #1362

Description

@Olowodarey

Labels: backend, enhancement, predictions

Problem

Users cannot export their prediction history for record-keeping or tax purposes; data is only available through paginated API reads.

Requirements

  1. Add GET /predictions/export returning a streamed CSV of the caller's predictions.
  2. Support date-range filtering.
  3. Stream results to avoid loading all rows into memory.
  4. Set correct content-type and attachment headers.

Acceptance Criteria

  • The endpoint returns a valid CSV of the user's predictions.
  • Date filtering narrows the export correctly.
  • Large exports stream without excessive memory use.
  • Tests cover header, content, and filter behavior.

Files

backend/src/predictions/predictions.controller.ts, backend/src/predictions/predictions.service.ts, backend/src/predictions/dto

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions