[PM-37599] refactor: Remove PM37597 always-enable-Stripe-automatic-tax feature flag#7989
Conversation
…x feature flag The pm-37597-always-enable-stripe-automatic-tax flag has been at 100% in production since 2026.6.0, so its flag-OFF path is dead code. Remove the flag and delete the legacy branches that programmatically wrote Stripe tax_exempt, making the flag-ON behavior unconditional: Stripe is the source of truth for taxability (customers default to tax_exempt = "none") and the tax-ID banner is gated on Stripe's view rather than a hardcoded country list. No end-user behavior change. Relocates the postal-code country check off the now-deleted TaxHelpers onto OrganizationCreateRequestModel. Final story of epic PM-36315.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This is a pure code-debt removal of the Code Review DetailsNo blocking findings. Verification performed:
|
…ipe-automatic-tax
| [InlineData("", false)] | ||
| public void Validate_PaidPlanWithoutPostalCode_RequiresPostalCodeForExpectedCountries( | ||
| string? billingAddressCountry, | ||
| bool postalCodeRequired) |
There was a problem hiding this comment.
postalCodeRequired is the expected outcome so I'd prefer if this was split into two tests, one expecting true other for false.
🎟️ Tracking
Jira: PM-37599 — final story of epic PM-36315 "Simplify tax logic". Predecessors shipped in 2026.6.0: PM-37597 (#7662), PM-37598 (#7677), PM-37820 defect (#7719).
📔 Objective
Removes the
PM37597_AlwaysEnableStripeAutomaticTaxfeature flag (LaunchDarkly keypm-37597-always-enable-stripe-automatic-tax) and deletes the now-dead flag-OFF tax logic, making the flag-ON behavior unconditional. The flag has been at 100% in production since 2026.6.0, so this is a pure code-debt removal with no end-user behavior change.What this locks in
tax_exempt = "none"(taxable) andautomatic_taxstays enabled.tax_exempt, so a CS-set exemption in Stripe is never overwritten.Changes
tax_exemptwrite branches across the org/provider/premium/payment commands,UpcomingInvoiceHandler, andProviderBillingService(keeping the already-unconditionalautomatic_taxwrites).GetOrganizationWarningsQueryandGetProviderWarningsQueryto the flag-ON conditions.TaxHelpers; relocate the{US, CH}postal-code check ontoOrganizationCreateRequestModelasRequiresBillingPostalCode(runtime behavior unchanged).GetCustomerWhileEnsuringCorrectTaxExemptionAsync(its reconciliation is dead once the flag is always-true).IFeatureServicedependency from 7 classes and delete the flag constant.No contract or data-model change — the warnings response shape and banner conditions are exactly what production already serves. Server-only, V±2 safe.
Post-merge ops (outside this repo): archive the LaunchDarkly flag
pm-37597-always-enable-stripe-automatic-tax.