Blocca la seconda diretta sullo stesso utente, registra gli abusi in admin e presenta la copertina come grafica caricata dalla società, con demo Team MLTV. Co-authored-by: Cursor <cursoragent@cursor.com>
49 lines
1.5 KiB
Ruby
49 lines
1.5 KiB
Ruby
load Rails.root.join("db/seeds/plans.rb")
|
|
|
|
AdminAccount.find_or_create_by!(username: "admin") do |a|
|
|
a.password = "AdminPass123"
|
|
end
|
|
|
|
coach = User.find_or_create_by!(email: "coach@matchlivetv.test") do |u|
|
|
u.name = "Coach Demo"
|
|
u.password = "Password123"
|
|
u.role = "coach"
|
|
end
|
|
|
|
admin = User.find_or_create_by!(email: "admin@matchlivetv.test") do |u|
|
|
u.name = "Admin"
|
|
u.password = "Password123"
|
|
u.role = "admin"
|
|
end
|
|
|
|
club = Club.find_or_create_by!(name: MatchLiveTv::Demo.home_team) 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: MatchLiveTv::Demo::CATEGORY) do |t|
|
|
t.sport = "volleyball"
|
|
end
|
|
|
|
UserTeam.find_or_create_by!(user: admin, team: team) { |ut| ut.role = "member" }
|
|
|
|
Billing::AssignPlan.call(club: club, plan_slug: "free") unless club.subscription
|
|
|
|
match = team.matches.find_or_create_by!(opponent_name: MatchLiveTv::Demo::AWAY_TEAM) do |m|
|
|
m.location = MatchLiveTv::Demo.venue
|
|
m.scheduled_at = 2.hours.from_now
|
|
m.sets_to_win = 3
|
|
m.roster_numbers = [4, 6, 8, 9, 10, 11, 12, 14, 16, 17, 21]
|
|
m.category = MatchLiveTv::Demo::CATEGORY
|
|
m.phase = "Semifinale"
|
|
end
|
|
|
|
puts "Seed OK: coach@matchlivetv.test / Password123"
|
|
puts "Club: #{club.name}, Team: #{team.name}, Match: #{match.opponent_name}"
|
|
|
|
home = Streams::NodeRegistry.ensure_home_from_env!
|
|
puts "Stream node home: #{home.slug} rtmp=#{home.rtmp_base_url}"
|