modcomms/backend/app/api
Vadym Samoilenko 447c4b2a95 Add CSV export of campaign data for super_admin and oversight_admin
Adds a server-side CSV export covering all campaign, proof, and version
data including agent RAG statuses. The export respects the active agency
filter so oversight admins can scope the download to a single agency.

- backend: `CampaignRepository.get_export_rows()` — flat join across
  Campaign → Proof → ProofVersion with Agency and User, extracts agent
  RAG statuses from the `agent_review` JSONB column
- backend: `GET /api/export/campaigns-csv` endpoint gated to
  super_admin / oversight_admin, streams a dated CSV file
- frontend: `apiService.downloadCampaignsCsv(agencyId?)` — fetches blob
  and triggers browser download
- frontend: threads `selectedAgencyId` prop from App → Campaigns →
  CampaignList so the export uses the active filter
- frontend: Export CSV button in CampaignList header, visible only to
  super_admin / oversight_admin, with spinner while downloading

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 11:35:24 +00:00
..
__init__.py Replace WebSocket with REST polling to fix GCP LB 30s timeout 2026-03-18 15:26:01 +00:00
analysis_routes.py Replace WebSocket with REST polling to fix GCP LB 30s timeout 2026-03-18 15:26:01 +00:00
knowledge_base_routes.py Fix processing job not visible to background task (FK violation) 2026-02-12 16:09:50 -06:00
knowledge_base_schemas.py Add Knowledge Base management system for AI agent specs 2026-02-12 15:00:36 -06:00
routes.py Add CSV export of campaign data for super_admin and oversight_admin 2026-03-19 11:35:24 +00:00
schemas.py Add per-agency analytics breakdown table for admin users 2026-02-22 14:33:48 -06:00