Add CSV export endpoint to Reports API#8
Open
shubhusion wants to merge 1 commit into
Open
Conversation
Implements GET /reports/export returning RFC 4180-compliant CSV with the same filter/sort params as GET /reports but without pagination. Uses ReportPublic to ensure internal_id and owner_email are never exposed. Includes 8 tests covering content-type, field safety, filtering, RFC 4180 edge cases, and full 120-row unfiltered export. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /reports/exportendpoint returning RFC 4180-compliant CSVstatus,date_from,date_to,sort,descendingfilter params asGET /reports— no pagination capReportPublicto ensureinternal_idandowner_emailare never exposed in the outputTest plan
test_export_returns_csv_content_type— Content-Type header istext/csvtest_export_has_content_disposition— attachment filename isreports.csvtest_export_header_row— columns areid,title,status,owner,amount,created_attest_export_no_internal_fields—internal_idandowner_emailabsent from all rowstest_export_filter_by_status—?status=approvedreturns only approved rowstest_export_rfc4180_edge_case— title with commas, quotes, and embedded newline parses back as a single fieldtest_export_invalid_sort_returns_400— bad sort field returns 400test_export_all_rows_no_pagination— unfiltered export returns all 120 seed rows (8/8 passing)🤖 Generated with Claude Code