Repository navigation
fix(billing): Free plan shows the trial up front, search joins the hosted-key gate, trial and plan-end emails - #10389
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Critical impact] The PR appears safe to merge; the latest change prevents false plan-ended notices when coverage cannot be checked. SummaryThis PR adds trial offers, billing emails, an option to start paying early, and paid-plan checks for hosted search. Schedules stop immediately when a run is refused a hosted key.
Reviews (4) · Last reviewed commit: "fix(billing): skip the plan-ended notice..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 35 files
This PR changes payment, billing, or quota logic. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 35 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 35 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…sted-key gate, trial and plan-end emails, paid-plan schedules stop at once
… a failed send, eligibility-accurate trial copy
…, stronger search-gate assertion
fcf92bd to
da279fd
Compare
Summary
/api/billing(personal) returnsproTrialEligible, from a newisProTrialEligiblethatgetProTrialCheckoutParamsnow shares.mayUseHostedKey. A free payer now gets the same 402 as every other hosted tool.customer.subscription.trial_will_endemails the date, the charge (from the Stripe price) and how to cancel. Idempotent per subscription and trial end.paid_plan_requiredreason, instead of failing 100 times first. Other failures still count toward the limit.POST /api/billing/end-trial, session-onlybilling.trial.endoperation, own trialing personal subscription only, Stripetrial_end: 'now'). The trial-exhausted usage card points there.Type of Change
Testing
lib/billing/free-plan.integration.ts(real Postgres; Stripe, mail and schedule notifications stubbed), 9 cases: search refused for a free payer and allowed for a paid one; schedule disabled on the hosted-key refusal and counted otherwise; trial reminder sent once across redeliveries and not for a non-trialing sub; end-trial for your own trial, refused for a paid plan and for another account's trial.trial.integration.ts(25) passes.check:source-conventions,check:boundaries,check:comment-hygiene,check:file-names,check:api-validation:strict,check:client-boundary,check:test-patterns,check:api-contract-routes,check:permission-group-enforcement,check:application-graph,check:route-verbs,check:mapper-operation. CI runs type-check and the full audits.Checklist
test-auditauthoring gate)