Billing Stripe, link regia mobile e staff solo trasmissione.

Aggiunge fatturazione club, pagina regia condivisibile senza account, roster squadre e rimuove la modalità controller dall'app (v1.1.0).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 07:23:13 +02:00
parent 4083bc5dee
commit f4b7be0f80
156 changed files with 5033 additions and 2033 deletions

View File

@@ -2,7 +2,7 @@ module Api
module V1
class TeamsController < BaseController
def index
teams = current_user.manageable_teams.includes(:club, :matches)
teams = current_user.streamable_teams
render json: teams.map { |t| team_json(t) }
end
@@ -27,7 +27,8 @@ module Api
end
def recordings
team = current_user.manageable_teams.find(params[:id])
team = current_user.streamable_teams.find { |t| t.id.to_s == params[:id].to_s }
raise ActiveRecord::RecordNotFound unless team
unless team.entitlements.can_access_recordings?
return render json: {
error: "Archivio gare disponibile con Premium Light o Full",
@@ -89,16 +90,16 @@ module Api
staff_manage_url: ent.staff_manage_url,
max_staff: ent.max_staff,
max_staff_transmission: ent.max_staff_transmission,
max_staff_regia: ent.max_staff_regia,
staff_used: ent.staff_count,
staff_transmission_used: ent.staff_count_for("transmission"),
staff_regia_used: ent.staff_count_for("regia"),
concurrent_streams_used: ent.concurrent_streams_used,
concurrent_streams_limit: ent.concurrent_streams_limit,
recordings_enabled: ent.can_access_recordings?,
phone_download_enabled: ent.phone_download_enabled?,
youtube_enabled: ent.youtube_enabled?,
youtube_mode: ent.plan.youtube_mode
youtube_mode: ent.plan.youtube_mode,
staff_role: current_user.staff_role_for(team),
can_stream: current_user.can_stream_for?(team)
}
if detail
data[:members] = team.user_teams.includes(:user).where.not(role: "owner").map do |ut|