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

@@ -0,0 +1,32 @@
require "rails_helper"
RSpec.describe Billing::Stripe::PlanChangeKind do
before { load Rails.root.join("db/seeds/plans.rb") }
it "classifica light → full come upgrade" do
expect(described_class.classify(
from_plan_slug: "premium_light",
from_interval: "monthly",
to_plan_slug: "premium_full",
to_interval: "monthly"
)).to eq(:upgrade)
end
it "classifica full → light come downgrade" do
expect(described_class.classify(
from_plan_slug: "premium_full",
from_interval: "monthly",
to_plan_slug: "premium_light",
to_interval: "monthly"
)).to eq(:downgrade)
end
it "classifica passaggio a annuale come upgrade sullo stesso piano" do
expect(described_class.classify(
from_plan_slug: "premium_light",
from_interval: "monthly",
to_plan_slug: "premium_light",
to_interval: "yearly"
)).to eq(:upgrade)
end
end