Login admin con cambio password, metriche server (CPU/RAM/disco/banda), grafici e statistiche streaming; sezione piani ridimensionata. Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.1 KiB
Ruby
39 lines
1.1 KiB
Ruby
load Rails.root.join("db/seeds/plans.rb")
|
|
|
|
AdminAccount.find_or_create_by!(username: "admin") do |a|
|
|
a.password = "admin"
|
|
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
|
|
|
|
team = Team.find_or_create_by!(name: "Tigers Volley") 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
|
|
|
|
match = team.matches.find_or_create_by!(opponent_name: "ASD Eagles Pavia") do |m|
|
|
m.location = "PalaTigers - Milano"
|
|
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 = "U16"
|
|
m.phase = "Semifinale"
|
|
end
|
|
|
|
puts "Seed OK: coach@matchlivetv.test / password123"
|
|
puts "Team: #{team.name}, Match: #{match.opponent_name}"
|