Feat: Add Organization Subscription-Preview Endpoint - #8245
Feat: Add Organization Subscription-Preview Endpoint#8245sbrown-livefront wants to merge 22 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## billing/PM-39925/invoice-preview-projection #8245 +/- ##
==============================================================================
Coverage ? 63.43%
==============================================================================
Files ? 2425
Lines ? 104542
Branches ? 9495
==============================================================================
Hits ? 66312
Misses ? 35954
Partials ? 2276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a72b6a3 to
72c51a8
Compare
Includes the automatic packages.lock.json updates for Api and Api.Test reflecting the new project-reference graph.
…in Bit.Invoicing Address review feedback on PR #8208: the feature libraries no longer take a Core dependency for the feature flag key. - Add InvoicingFeatureFlags ([FlagKeyCollection]) in Bit.Invoicing holding PM36631_PreviewDrivenCart, and register it as a known flag from AddInvoicing via AddKnownFeatureFlags. - Reference Bit.Invoicing's key from both subscription endpoint groups and remove the constant from Core's FeatureFlagKeys. - Reference the Bitwarden.Server.Sdk meta-SDK in Bit.Invoicing so the [FlagKeyCollection] source generator runs; this also aligns the library lock files' platform package versions up to Core's baseline. - Trim the FeatureFlagKeys row from the subscription library README debt tables (Policies.Application remains) and note the ownership in Invoicing. - Replace the Invoicing.Test placeholder with a test asserting AddInvoicing registers the flag as a known feature flag.
…ionEndpointsHandler
ad72c4f to
6f86df0
Compare
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Re-reviewed after the latest push. The duplicate, unprefixed Code Review DetailsNo new findings. Previously raised and now addressed:
Still open, acknowledged by the author as follow-up work:
Notes:
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-39927
📔 Objective
First endpoint on the new
Bit.Subscriptions.Organizationfeature library and first consumer of the shared, Stripe-invoice-preview–driven cart summary. Sources the organization's upcoming-renewal cart totals from an actual Stripe invoice preview instead of reconstructing them from local subscription state.Adds:
GetSubscriptionPreviewQuery(Bit.Invoicing) — shared,ISubscriber-generic query ported fromGetBitwardenSubscriptionQuery. Resolves tier/cadence (collapsingTeamsStarter → Teams), previews viacreate_preview(subscription=id), falls back to the subscription overload when there's no upcoming invoice, and maps subscription status →SubscriptionPreviewenvelope (suspension/grace-period/cancel). Registered inAddInvoicing(). The Organization path is fully wired here; the User/Premium path is stubbed for Task 8.GET /organizations/{organizationId:guid}/billing/subscription/preview— new route on the org subscription group, gated behindPM36631_PreviewDrivenCart.AuthorizeAttribute<OrganizationBillingRequirement>using theIOrganizationRequirementframework (Owner or confirmed provider-user-for-org; excludes Admin/Custom). Lives entirely in theOrganizationAuthorizationlibrary — no dependency on theApiproject.