Skip to content

feat(portal): require approval for reset proration on same-interval - #14058

Merged
maximevast merged 4 commits into
mainfrom
maxime/portal-reset-proration-approval
Sep 1, 2026
Merged

feat(portal): require approval for reset proration on same-interval#14058
maximevast merged 4 commits into
mainfrom
maxime/portal-reset-proration-approval

Conversation

@maximevast

@maximevast maximevast commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

reset proration 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

  • This PR addresses a single concern (one bug fix, one feature, one refactor)
  • The diff is reasonably sized and easy to review
  • New functionality is covered by tests
  • Linting and type checking pass (uv run task lint && uv run task lint_types)
  • No unrelated changes or drive-by fixes are included

Review in cubic

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
orbit Ready Ready Preview Sep 1, 2026 6:25am UTC
polar-test Ready Ready Preview Sep 1, 2026 6:25am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread clients/apps/web/src/components/CustomerPortal/CustomerChangePlanModal.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@maximevast
maximevast enabled auto-merge September 1, 2026 06:25
@maximevast
maximevast added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 1aa71f6 Sep 1, 2026
36 of 51 checks passed
@maximevast
maximevast deleted the maxime/portal-reset-proration-approval branch September 1, 2026 06:34
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.

2 participants