Create a backend API route that generates a downloadable CSV or PDF report summarizing the dashboard's financial metrics over a requested date range.
Contribution Guide
- PRs go to the dev branch, not main
- Please application must explain a short specific approach to this task
- PR description must clearly describe what you built and changed
- Link your PR to the correct issue number
Implementation Guidelines
- Key files:
src/app/api/v1/dashboard/export/route.ts, src/server/utils/export.utils.ts
- Create a
GET method accepting ?format=csv (or pdf) and date range parameters.
- Aggregate the metrics from the DB and use a library like
json2csv or pdfmake to generate the file buffer.
- Set proper
Content-Disposition headers to trigger a file download in the browser.
Expectations
- What done looks like: Hitting the endpoint initiates an immediate file download in the browser containing accurate financial summaries for the specified dates.
- Discord for questions: codeze_us
Create a backend API route that generates a downloadable CSV or PDF report summarizing the dashboard's financial metrics over a requested date range.
Contribution Guide
Implementation Guidelines
src/app/api/v1/dashboard/export/route.ts,src/server/utils/export.utils.tsGETmethod accepting?format=csv(or pdf) and date range parameters.json2csvorpdfmaketo generate the file buffer.Content-Dispositionheaders to trigger a file download in the browser.Expectations