feat(portal): require approval for reset proration on same-interval - #14058
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Adds 'reset' proration copy and handling but also changes willIssueInvoice to skip immediate-invoice consent for trialing customers, an unexplained behavior change affecting billing approval.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Confidence score: 2/5
- In
clients/apps/web/src/components/CustomerPortal/CustomerChangePlanModal.tsx, reset-proration changes—including same-interval changes—can now be charged immediately without customer approval, despite the modal messaging; restore the approval-checkbox requirement before allowing the change.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="clients/apps/web/src/components/CustomerPortal/CustomerChangePlanModal.tsx">
<violation number="1" location="clients/apps/web/src/components/CustomerPortal/CustomerChangePlanModal.tsx:188">
P1: For reset proration changes, including same-interval changes, `canChangePlan` no longer requires customer approval even though the modal says the customer will be charged immediately. Restore the approval checkbox and gate submission for immediate invoice/reset changes, while keeping trial updates exempt from that gate.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| willIssueInvoice, | ||
| approveImmediateInvoice, | ||
| ]) | ||
| }, [hasPaymentMethod, selectedProduct, subscription]) |
There was a problem hiding this comment.
P1: For reset proration changes, including same-interval changes, canChangePlan no longer requires customer approval even though the modal says the customer will be charged immediately. Restore the approval checkbox and gate submission for immediate invoice/reset changes, while keeping trial updates exempt from that gate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At clients/apps/web/src/components/CustomerPortal/CustomerChangePlanModal.tsx, line 188:
<comment>For reset proration changes, including same-interval changes, `canChangePlan` no longer requires customer approval even though the modal says the customer will be charged immediately. Restore the approval checkbox and gate submission for immediate invoice/reset changes, while keeping trial updates exempt from that gate.</comment>
<file context>
@@ -176,32 +175,17 @@ const CustomerChangePlanModal = ({
- willIssueInvoice,
- approveImmediateInvoice,
- ])
+ }, [hasPaymentMethod, selectedProduct, subscription])
const updateSubscription = useCustomerUpdateSubscription(api)
</file context>
Summary
resetproration always charges immediately, but the modal only treated it as immediate when the interval changed. A same-interval plan change rendered no message, and therefore no approval checkbox.Adds the missing reset case to both portal components, and drops 'month' from the proration copy, which is wrong on yearly subscriptions.
Driven by work on unit based pricing.
❓
why does plan change require a confirm checkbox while seat change has no consent mechanism at all❓ℹ️ Discussed with @pieterbeulque , checkbox removed
Checklist
uv run task lint && uv run task lint_types)