Club come entità principale, branding e fix infrastruttura streaming.

Introduce clubs con abbonamento, branding Active Storage e flusso registrazione società; corregge healthcheck MediaMTX (immagine distroless) e allinea dominio produzione matchlivetv.it.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-27 09:16:24 +02:00
parent 471291b2c4
commit 4083bc5dee
53 changed files with 1120 additions and 197 deletions

View File

@@ -16,14 +16,21 @@ admin = User.find_or_create_by!(email: "admin@matchlivetv.test") do |u|
u.role = "admin"
end
team = Team.find_or_create_by!(name: "Tigers Volley") do |t|
club = Club.find_or_create_by!(name: "Tigers Volley") do |c|
c.sport = "volleyball"
c.primary_color = "#e53935"
c.secondary_color = "#ffffff"
end
ClubMembership.find_or_create_by!(user: coach, club: club) { |m| m.role = "owner" }
team = club.teams.find_or_create_by!(name: "Under 16") do |t|
t.sport = "volleyball"
end
UserTeam.find_or_create_by!(user: coach, team: team) { |ut| ut.role = "owner" }
UserTeam.find_or_create_by!(user: admin, team: team) { |ut| ut.role = "member" }
Billing::AssignPlan.call(team: team, plan_slug: "free") unless team.subscription
Billing::AssignPlan.call(club: club, plan_slug: "free") unless club.subscription
match = team.matches.find_or_create_by!(opponent_name: "ASD Eagles Pavia") do |m|
m.location = "PalaTigers - Milano"
@@ -35,4 +42,4 @@ match = team.matches.find_or_create_by!(opponent_name: "ASD Eagles Pavia") do |m
end
puts "Seed OK: coach@matchlivetv.test / password123"
puts "Team: #{team.name}, Match: #{match.opponent_name}"
puts "Club: #{club.name}, Team: #{team.name}, Match: #{match.opponent_name}"