Skip to content

[PM-38333] feat: Annual billing savings offer on cancel#21939

Open
kdenney wants to merge 14 commits into
mainfrom
billing/PM-38333/annual-billing-savings-on-cancel
Open

[PM-38333] feat: Annual billing savings offer on cancel#21939
kdenney wants to merge 14 commits into
mainfrom
billing/PM-38333/annual-billing-savings-on-cancel

Conversation

@kdenney

@kdenney kdenney commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-38333

Associated PRs

📔 Objective

Adds the client side of the annual billing savings offer. When an owner of a Teams or Enterprise monthly organization opens the cancellation offboarding survey and selects the cost reason, an inline callout shows the projected annual savings and an option to switch to annual billing at the next renewal. Accepting calls the redeem endpoint and closes the flow; declining continues the normal cancellation. The organization subscription page also reflects a pending switch during the window between redemption and renewal.

Changes

  • OrganizationBillingClient: methods to fetch the annual upgrade offer and redeem it.
  • Offboarding survey: loads the offer on init (failures are swallowed so the survey still works), shows the savings callout on the cost cancellation reason, and redeems on accept. The callout is gated on the cancellation reason whose label refers to cost, accounting for the legacy reason value codes not matching their displayed labels. Layout and copy match the design (two-column label and right-aligned amount).
  • Organization subscription page: parses a new pendingAnnualUpgrade field on the subscription response and, when present, shows the scheduled annual plan name, per-year cadence, and annual amounts with an effective-date callout, instead of the stale monthly values.
  • subscription-status component: derives the displayed plan name from pendingAnnualUpgrade when a switch is scheduled.
  • New English locale strings for the callout and the subscription-page pending state.
  • Unit tests for the billing client methods, the offboarding survey callout behavior, the subscription page, the subscription-status component, and the response model.

📸 Screenshots

image image image

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.23%. Comparing base (7bddd1b) to head (7b7abe7).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...app/billing/shared/offboarding-survey.component.ts 87.09% 1 Missing and 3 partials ⚠️
...tions/organization-subscription-cloud.component.ts 0.00% 0 Missing and 3 partials ⚠️
...els/response/organization-subscription.response.ts 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21939      +/-   ##
==========================================
+ Coverage   52.12%   52.23%   +0.10%     
==========================================
  Files        4116     4116              
  Lines      130285   130340      +55     
  Branches    20454    20464      +10     
==========================================
+ Hits        67917    68087     +170     
+ Misses      57350    57200     -150     
- Partials     5018     5053      +35     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kdenney kdenney added t:feature Change Type - Feature Development ai-review Request a Claude code review labels Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the client side of the annual billing savings offer: the two new OrganizationBillingClient methods, the offboarding survey callout and redeem flow, the pendingAnnualUpgrade parsing on the subscription response model, and the subscription page and status component updates. The change is well-scoped, matches existing billing patterns, and is thoroughly unit tested (client methods, survey callout behavior, subscription page line-item sourcing, status component, and response model).

Code Review Details

No blocking findings.

Notes considered and intentionally not flagged:

  • The legacy cancellation-reason gating on "too_complex" is a backend value/label mismatch, but it is clearly documented inline and covered by dedicated tests.
  • switchToAnnualBilling swallows its own errors to render an inline message instead of the bitAction toast; the resulting overlap with the directive's automatic loading state is redundant but not a bug.
  • The new locale keys are web-only strings for web-only components, so the single-en-locale edit is correct.

kdenney added 2 commits July 21, 2026 10:02
Design flagged the leading "i" icon as misplaced on the annual-billing
offer callout in the Cancel subscription dialog, since it reads as an
offer rather than a typical informational message. Pass [icon]="null"
to the bit-callout to suppress it while keeping the info styling. The
Subscription page callouts are unaffected and retain their icon.
@kdenney
kdenney marked this pull request as ready for review July 21, 2026 15:20
@kdenney
kdenney requested a review from a team as a code owner July 21, 2026 15:20
@kdenney
kdenney requested a review from sbrown-livefront July 21, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant