From 7fe8bc81c67613f9f0953bb17723c9716080df60 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Tue, 5 May 2026 09:10:59 -0400 Subject: [PATCH] Exclude trial companies from MRR/ARR and revenue trend Companies with null StripeSubscriptionId are on trial and have no real subscription income. They were being counted as paying Active/GracePeriod customers, inflating MRR, ARR, plan distribution, and 12-month trend. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/Controllers/RevenueController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Web/Controllers/RevenueController.cs b/src/PowderCoating.Web/Controllers/RevenueController.cs index 04fe5ea..feb0b83 100644 --- a/src/PowderCoating.Web/Controllers/RevenueController.cs +++ b/src/PowderCoating.Web/Controllers/RevenueController.cs @@ -74,9 +74,10 @@ public class RevenueController : Controller // ── Revenue metrics ────────────────────────────────────────────── - // Active paying companies + // Active paying companies — exclude trials (no StripeSubscriptionId = on trial) var payingActive = companies .Where(c => + !string.IsNullOrEmpty(c.StripeSubscriptionId) && (c.SubscriptionStatus == SubscriptionStatus.Active || c.SubscriptionStatus == SubscriptionStatus.GracePeriod)) .ToList(); @@ -111,6 +112,7 @@ public class RevenueController : Controller // ── Plan distribution ──────────────────────────────────────────── var planDistribution = companies .Where(c => !c.IsComped && + !string.IsNullOrEmpty(c.StripeSubscriptionId) && (c.SubscriptionStatus == SubscriptionStatus.Active || c.SubscriptionStatus == SubscriptionStatus.GracePeriod)) .GroupBy(c => c.SubscriptionPlan) @@ -137,6 +139,7 @@ public class RevenueController : Controller var activeInMonth = companies .Where(c => !c.IsComped && + !string.IsNullOrEmpty(c.StripeSubscriptionId) && c.CreatedAt < monthEnd && (c.SubscriptionStatus == SubscriptionStatus.Active || c.SubscriptionStatus == SubscriptionStatus.GracePeriod ||