[PM 33923]Add support for multiple organization discounts to organization subscription page#7531
Conversation
…ganization-discounts-to-organization-subscription-pag
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7531 +/- ##
=======================================
Coverage 59.14% 59.14%
=======================================
Files 2077 2077
Lines 91864 91894 +30
Branches 8178 8180 +2
=======================================
+ Hits 54331 54352 +21
- Misses 35601 35608 +7
- Partials 1932 1934 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ganization-discounts-to-organization-subscription-pag
|
Great job! No new security vulnerabilities introduced in this pull request |
amorask-bitwarden
left a comment
There was a problem hiding this comment.
❌ There's quite a few changes here to the GetBitwardenSubscriptionQuery, which is currently only utilized for Premium. Multiple premium discounts is being addressed in PM-35121, so I believe this PR's scope extends too far. Can you ensure the changes are specifically focused on surfacing multiple organization discounts?
Remove changes to GetBitwardenSubscriptionQuery, Cart, and their tests to keep this PR focused on organization discounts. Multiple premium discounts will be addressed separately in PM-35121.
…ganization-discounts-to-organization-subscription-pag
|
amorask-bitwarden
left a comment
There was a problem hiding this comment.
Good work - still a few things we can remove though to tighten it up.
|
|
||
| var subscriptionInfo = await paymentService.GetSubscriptionAsync(organization); | ||
| if (subscriptionInfo?.CustomerDiscount?.Id != StripeConstants.CouponIDs.SecretsManagerStandalone) | ||
| if (subscriptionInfo?.CustomerDiscounts.Any(d => d.Id == StripeConstants.CouponIDs.SecretsManagerStandalone) != true) |
There was a problem hiding this comment.
| if (subscriptionInfo?.CustomerDiscounts.Any(d => d.Id == StripeConstants.CouponIDs.SecretsManagerStandalone) != true) | |
| if (subscriptionInfo?.CustomerDiscounts.Any(d => d.Id != StripeConstants.CouponIDs.SecretsManagerStandalone)) |
…ganization-discounts-to-organization-subscription-pag
amorask-bitwarden
left a comment
There was a problem hiding this comment.
Thanks for clearing up my question. Changes look good. Nice work!




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-33923
📔 Objective
The organization subscription page previously only supported a single discount (CustomerDiscount). This PR updates the billing infrastructure to support multiple concurrent
discounts (CustomerDiscounts) — for example, a customer may have both a Milestone 2 migration discount and a Secrets Manager standalone discount at the same time.
Changes
API Response Models:
can see migration (M3/Families), SM standalone, and M2 discounts.
Core Billing:
discounts are merged/overridden rather than replacing the whole discount.
coupon IDs to Stripe's upcoming invoice API.
📸 Screenshots