Skip to content

feat(signup): no-card 7-day trial on Starter plan - #38

Merged
paulocastellano merged 8 commits into
mainfrom
feat/trial-without-card
May 14, 2026
Merged

paulocastellano merged 8 commits into
mainfrom
feat/trial-without-card

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

New signups land on a 7-day generic trial (Cashier trial_ends_at) without a Stripe customer or subscription. Account is on Starter plan limits during the trial. After 7 days, EnsureAccountReady redirects to /subscribe per the existing flow.

  • CreateUser sets account.trial_ends_at and plan_id = Starter
  • EnsureAccountReady allows access when subscribed() OR onGenericTrial()
  • Account::isOnTrial() includes generic trial check

Existing users unaffected: paying users have a subscription; never-paid users continue redirecting to /subscribe.

Paulo Castellano added 8 commits May 14, 2026 19:37
New signups land on a 7-day generic trial (Cashier trial_ends_at) without
a Stripe customer or subscription. Account is on Starter plan limits during
the trial. After 7 days, EnsureAccountReady redirects to /subscribe per the
existing flow.

- CreateUser sets account.trial_ends_at and plan_id = Starter
- EnsureAccountReady allows access when subscribed() OR onGenericTrial()
- Account::isOnTrial() includes generic trial check

Existing users unaffected: paying users have a subscription;
never-paid users continue redirecting to /subscribe.
…efault

- BillingController::index reads onTrial from Account::isOnTrial() (covers
  generic trial without a Stripe subscription) and falls back to
  account.trial_ends_at when no subscription exists. Vue page already had
  the badge + 'Trial ends' UI wired — just needed the right props.
- Drop default trial_days from 8 to 7 for consistency with messaging.
…ial()

Centralizes the 'is the user on any kind of trial?' question in the model.
Equivalent behavior — Cashier's subscribed() already includes trialing
subscriptions — but semantically cleaner and easier to extend.
…lEndsAt()

Centralizes 'what date should the UI show as trial end?' on the model.
Returns null when not on trial, the subscription's trial date when on
trial-with-card, or the generic trial date for no-card users.
Trial now exists exclusively at signup (no-card generic trial). The
/subscribe page is reached only after the trial has been consumed (or to
upgrade plans), so it should never offer another trial — that would be a
double-trial loophole.

- BillingController::subscribe drops trialDays prop
- BillingController::checkout drops ->trialDays() call (direct charge)
- Subscribe.vue drops trialDays prop and :days placeholders
- i18n (en/pt-BR/es): new subscribe-focused copy, remove start_trial/trial_info
- StripeEventListener::handleSubscriptionCreated nulls account.trial_ends_at
  when a Stripe subscription is created. Prevents 'Trial' badge from
  lingering for users who convert mid-generic-trial to paid.
- Drop unused trialDays global Inertia prop (no frontend consumers after
  /subscribe redesign).

Tests added (10 new, 0 regressions, 1533 total):
- AccountTest: isOnTrial + activeTrialEndsAt across 4 scenarios
  (no trial, generic only, subscription only, both — subscription wins)
- StripeEventListenerTest: subscription created clears generic trial
- TrialMiddlewareAccessTest: trialing-with-card subscription passes
- BillingControllerTest: index exposes onTrial/trialEndsAt for the 3
  trial states (generic-only, subscription-only, paying); subscribe
  page no longer exposes trialDays prop
@paulocastellano
paulocastellano merged commit a9e8eff into main May 14, 2026
2 checks passed
@paulocastellano
paulocastellano deleted the feat/trial-without-card branch May 14, 2026 23:26
rx-roxxit added a commit to rx-roxxit/therxdesk that referenced this pull request Nov 20, 2026
…rypostit#38)

A guest opening the domain now reads a landing page instead of being sent to
the login screen, while a signed-in visitor still goes straight to the
calendar. `/` leaves the authenticated group and keeps its `app.home` name;
`HomeController` renders `public/Landing` or redirects.

One public layout serves the landing and the legal pages: a header with the
mark, the language picker and Sign in, and a footer with Terms, Privacy, the
support address, Source code, the AGPL credit and the language picker, plus a
Status link only when `SITE_STATUS_URL` is configured, so no public page links
to a page that does not exist. `/terms` and `/privacy` keep their Markdown,
titles and tests, now inside the shared layout.

The landing copy lives in `rxdesk.php` under `public`, written natively in all
16 locales (title, deck, Sign in, the signup-soon line, the footer links and
the skip link), with the single-line budgets added. `/pricing` stays
unregistered until the v3.0.0 selling pages ship.

Tests: guest landing and signed-in redirect, the public shell props and the
`/pricing` 404, a browser test (Sign in lands on login, language switch in
place with RTL, footer links, Status only when configured, signed-in
redirect), and the landing added to the 390px overflow guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant