Skip to content

fix(billing): trial-aware upgrade-card copy + near-renewal disable - #1145

Open
Navin-S-R wants to merge 3 commits into
developfrom
fix/trial-paid-upgrade-copy
Open

fix(billing): trial-aware upgrade-card copy + near-renewal disable#1145
Navin-S-R wants to merge 3 commits into
developfrom
fix/trial-paid-upgrade-copy

Conversation

@Navin-S-R

Copy link
Copy Markdown
Member

What

Makes the billing page's upgrade cards reflect the control-plane upgrade rules (pairs with the jarvis_admin_v2 proration fix).

  • Trial customer, same-cycle target → enabled, note: "Your free trial moves to this plan. Nothing is charged now; you're billed at the new price when your trial ends."
  • Trial customer, cross-cycle (Annual) targetdisabled, note: "Available once your free trial converts to a paid plan." (mirrors the server's TrialCrossCycleUnsupported refusal — no dead-end CTA.)
  • Within 24h of renewal → all upgrade cards disabled, note: "Your plan renews within a day - you can upgrade right after it renews." (mirrors the server's UpgradeTooCloseToRenewal refusal, driven by the new account.upgrade_locked_near_renewal flag.)
  • Paid customer → unchanged "You pay only the prorated difference for the days left in this period."

Testing

BillingPage.spec.js covers all four states (copy + native-disabled class): 79/79 vitest green, vite build clean, prettier@2.7.1 clean. Verified live in real Chrome across all four card states.

Notes

Requires the jarvis_admin_v2 PR (returns upgrade_locked_near_renewal + the trial/delta upgrade behaviour). Only BillingPage.vue + BillingPage.spec.js changed.

The billing page's upgrade cards now reflect the control-plane upgrade rules:
- a TRIAL customer sees "your free trial moves to this plan, nothing charged
  now" on same-cycle targets, and cross-cycle (Annual) targets are disabled
  with "available once your free trial converts" (the server refuses them);
- when within 24h of renewal the cards are disabled ("renews within a day")
  to mirror the server's UpgradeTooCloseToRenewal refusal, so no dead-end CTA.

Reads account.is_trial + the new account.upgrade_locked_near_renewal flag.
Paid customers keep the "prorated difference" copy. Verified live in-browser
across all four card states.
The upgrade cards promised a trial switch charges nothing, but doUpgrade's
confirm dialog still read "Charged now…" with a "Pay ₹0" CTA. Branch the
confirm copy on the preview `mode`: a trial_switch shows "No charge now - your
free trial moves to this plan; you'll be billed <target> when your trial ends"
with a "Switch plan" CTA; a paid upgrade keeps the prorated "Pay ₹…" charge.
upgrade_locked_near_renewal is a server-computed, time-based flag baked into
the account snapshot; current_period_end is not re-read as it passes, so a tab
left open across renewal kept every upgrade card disabled until a manual reload.
Re-read server truth when the tab becomes visible again, and poll (5-min) while
the lock is active so a continuously-open tab also clears on its own right after
renewal. Both stop once the lock is gone.
@Navin-S-R Navin-S-R added backport-version-15 Backporting PRs to version-15 backport-version-16 Backporting PRs to version-16 labels Sep 5, 2026
@Navin-S-R
Navin-S-R requested a review from kavin-114 September 5, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-version-15 Backporting PRs to version-15 backport-version-16 Backporting PRs to version-16

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants