feat(tournaments): add partnership tracking and tournament management
Implement comprehensive partnership tracking system and tournament management features including round-robin, single/double elimination, and Swiss system pairings. Changes: - Add partnership_games and partnership_stats tables - Implement PartnershipTracker service for recording partnership data - Add tournament generator with multiple formats - Create tournament management actions and views - Add acceptance tests for partnership tracking - Fix PartnershipTracker to use single snapshot per player per match - Fix round-robin test to query by round_number instead of hardcoded ID Note: All 8 acceptance tests now passing
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EuchreCamp
|
||||
module Actions
|
||||
module Admin
|
||||
module Tournaments
|
||||
module Participants
|
||||
class Destroy < EuchreCamp::Action
|
||||
include Deps[participants_repo: 'repositories.event_participants']
|
||||
|
||||
def handle(request, response)
|
||||
tournament_id = request.params[:id]
|
||||
player_id = request.params[:player_id]
|
||||
|
||||
participants_repo.remove_player(tournament_id, player_id.to_i)
|
||||
|
||||
response.flash[:message] = "Player removed from tournament"
|
||||
response.redirect_to("/admin/tournaments/#{tournament_id}")
|
||||
rescue StandardError => e
|
||||
response.flash[:error] = "Failed to remove player: #{e.message}"
|
||||
response.redirect_to("/admin/tournaments/#{tournament_id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user