Skip to content

Conversation

@johnrobertdelinila
Copy link

Summary

Implements CSV export functionality allowing musicians to export setlists
for sharing with band members and venue coordinators.

Changes Made

Core Layer

  • Added ISetlistExportService interface

Infrastructure Layer

  • Implemented SetlistExportService with CSV generation
  • Proper CSV escaping for special characters (commas, quotes, newlines)
  • Registered service in dependency injection

Web Layer

  • Created SetlistExportController with /api/SetlistExport/{id}/csv
    endpoint
  • Added "Export" button to Setlists.razor page
  • Authorization checks (users can only export their own setlists)

Features

Setlist Metadata:

  • Name, description, venue, performance date, duration, song count, export
    timestamp

Song Details:

  • Position, title, artist, key, BPM, duration, genre, difficulty
  • Performance notes, transition notes, encore/optional flags
  • Custom BPM/key overrides

Technical Implementation:

  • Follows Clean Architecture pattern
  • Comprehensive error handling and logging
  • Secure authorization checks
  • Sanitized CSV output

Testing

43 comprehensive unit tests:

  • 26 tests for SetlistExportService
  • 17 tests for SetlistExportController

Coverage includes:

  • Authorization (users can't export others' setlists)
  • CSV formatting and escaping
  • Edge cases (empty setlists, special characters)
  • Error handling

Run tests:

dotnet test --filter "FullyQualifiedName~SetlistExport"

Musician Use Case

Musicians can now:
1. Navigate to their setlists page
2. Click "Export" on any setlist
3. Download a CSV file with all song details
4. Share with band members or venue staff
5. Import into Excel/Google Sheets

Checklist

-  Code follows project conventions
-  Comprehensive test coverage (80%+)
-  No breaking changes
-  Clean Architecture maintained
-  Authorization implemented
-  Error handling included
-  Production-ready code

johnrobertdelinila and others added 2 commits October 29, 2025 11:42
This commit implements a new CSV export feature that allows musicians to export their setlists for sharing with band members and venue coordinators.

Changes:
- Added ISetlistExportService interface in Core layer
- Implemented SetlistExportService with CSV generation logic
- Created SetlistExportController with /api/SetlistExport/{id}/csv endpoint
- Added Export button to Setlists.razor UI
- Included comprehensive test suites for both service and controller
- Proper CSV escaping for special characters (commas, quotes, newlines)
- Authorization checks ensuring users can only export their own setlists

Features:
- Exports setlist metadata (name, venue, date, duration, notes)
- Exports all songs with details (title, artist, key, BPM, duration, genre, difficulty)
- Includes performance-specific data (custom BPM/key, notes, encore/optional flags)
- Maintains song order from setlist
- Generates sanitized filenames with setlist name and date
- Proper error handling and logging throughout

Test Coverage:
- 26 unit tests for SetlistExportService
- 17 unit tests for SetlistExportController
- Tests cover authorization, CSV formatting, edge cases, and error handling
- Targets 80%+ line and branch coverage requirement

Generated with Claude Code (claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eugenecp eugenecp linked an issue Dec 12, 2025 that may be closed by this pull request
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.

Add CSV Export functionality

1 participant