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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user