# EuchreCamp - Todo List ## Current Tasks ### Completed ✅ - [x] Add `site_admin` role to database schema and permissions system - [x] Add `isCasual` boolean field to Match model (already existed) - [x] Update match upload API to support casual matches - [x] Update match upload UI to include casual checkbox - [x] Add tournament deletion API endpoint with delete/orphan options - [x] Add delete tournament button and modal to tournament detail page - [x] Run tests and verify implementation (84 tests passing) - [x] Fix session issues with tournament admin access - [x] Fix Elo recalculation error for player merge (delete elo snapshots before deleting players) - [x] Add admin player management page - [x] Add player name editing functionality in admin UI - [x] Add admin panel links to navigation header - [x] Add tournament update API endpoint (PUT /api/tournaments/[id]) - [x] Consolidate delete endpoint from admin API to main tournaments API - [x] Update database schema to add variant scoring fields (targetScore, allowTies) - [x] Fix tie handling logic in partnership stats (ties now correctly tracked) - [x] Fix test files for normalizedName field in Player model - [x] Fix auth.ts to include normalizedName in Player creation - [x] Write TODO list to repository file ### In Progress 🔄 - [ ] Update API routes to handle new variant scoring fields - [ ] Update EditTournamentForm to add variant scoring controls - [ ] Update MatchEditor to use tournament-specific target score - [ ] Run tests and verify variant scoring implementation ### Backlog 📋 - [ ] Add UI controls for variant scoring in tournament creation/edit - [ ] Test variant tournament functionality end-to-end - [ ] Add validation for tie scores based on tournament configuration - [ ] Document variant tournament features ## Recently Completed (Detailed) ### Variant Euchre Scoring Support - Added `targetScore` and `allowTies` fields to Event model - Created database migration for new fields - Fixed partnership stats tie handling (ties now increment neither wins nor losses) - Updated Elo calculation functions to handle ties correctly (0.5 points for draw) ### Tournament Deletion - Consolidated delete endpoint to `/api/tournaments/[id]` - Added options to delete matches or orphan them - Updated DeleteTournamentButton to use consolidated endpoint ### Player Management - Added admin players page at `/admin/players` - Added player name editing functionality via PATCH endpoint - Added player merge functionality with automatic Elo recalculation - Fixed foreign key constraint issues with elo_snapshots ### Permissions - Added `site_admin` role as highest privilege level - Updated all permission functions to include site_admin support - Fixed session cache issues by reading roles from database ## Notes - All 84 unit tests passing - Database migrations applied successfully - TypeScript compilation has pre-existing errors unrelated to our changes