Skip to content

Conversation

@notvasub
Copy link
Collaborator

This PR implements CSV export functionality that allows administrators to download party registrations for a specified date range, enabling officers to have physical copies of the information when digital access is unavailable.

Changes:

  • Added export_parties_to_csv method to PartyService that accepts a list of Party models and generates a CSV file with the 11 columns highlighted in the TDD.
  • Added graceful handling for missing relationships (null location, contacts, or accounts) by populating empty strings in the CSV.
  • Added GET /api/parties/csv endpoint that accepts required start_date and end_date query parameters in YYYY-MM-DD format
  • Implemented date validation with a 400 error response for invalid formats
  • Added admin authentication requirement using existing authenticate_admin dependency
  • Added a ton of router and service tests.

Closes #63

@notvasub notvasub requested a review from naasanov November 11, 2025 22:29
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

Test Results Summary

281 tests  +21   281 ✅ +21   6s ⏱️ ±0s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 642468a. ± Comparison against base commit bfd9aa9.

♻️ This comment has been updated with latest results.

@manyuagashe manyuagashe requested review from manyuagashe and removed request for naasanov November 14, 2025 15:45
Copy link
Collaborator

@manyuagashe manyuagashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good except for the test issues I mentioned.

Copy link
Collaborator

@naasanov naasanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@naasanov naasanov merged commit 051c256 into main Nov 18, 2025
2 checks passed
@naasanov naasanov deleted the vasu/party-csv-export branch November 18, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Party CSV Export

4 participants