Billing upgrade/downgrade, inviti in app e diretta YouTube da mobile.

Upgrade Stripe con addebito immediato; downgrade programmato a fine periodo.
UX billing più sobria con box info; icone piani. API inviti e OAuth YouTube
per staff trasmissione; deep link join; scelta partita programmata o nuova.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 22:15:27 +02:00
parent 2cb267f991
commit 566104aff4
49 changed files with 1615 additions and 173 deletions

View File

@@ -2,11 +2,18 @@ module Api
module V1
class YoutubeController < BaseController
def authorize
team = current_user.manageable_teams.find(params[:team_id])
team = current_user.streamable_teams.find { |t| t.id.to_s == params[:team_id].to_s }
raise ActiveRecord::RecordNotFound unless team
team.entitlements.assert_can_connect_youtube!
state = Youtube::OauthState.for_team(team_id: team.id, user_id: current_user.id)
return_app = ActiveModel::Type::Boolean.new.cast(params[:return_app])
state = Youtube::OauthState.for_team(
team_id: team.id,
user_id: current_user.id,
return_app: return_app
)
url = Youtube::OauthUrl.build(state: state, redirect_uri: ENV.fetch("YOUTUBE_REDIRECT_URI"))
render json: { authorization_url: url }
render json: { authorization_url: url, return_app: return_app }
end
end
end