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 ──────────────────────────────────────────────
|
// ── Revenue metrics ──────────────────────────────────────────────
|
||||||
|
|
||||||
// Active paying companies
|
// Active paying companies — exclude trials (no StripeSubscriptionId = on trial)
|
||||||
var payingActive = companies
|
var payingActive = companies
|
||||||
.Where(c =>
|
.Where(c =>
|
||||||
|
!string.IsNullOrEmpty(c.StripeSubscriptionId) &&
|
||||||
(c.SubscriptionStatus == SubscriptionStatus.Active ||
|
(c.SubscriptionStatus == SubscriptionStatus.Active ||
|
||||||
c.SubscriptionStatus == SubscriptionStatus.GracePeriod))
|
c.SubscriptionStatus == SubscriptionStatus.GracePeriod))
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -111,6 +112,7 @@ public class RevenueController : Controller
|
|||||||
// ── Plan distribution ────────────────────────────────────────────
|
// ── Plan distribution ────────────────────────────────────────────
|
||||||
var planDistribution = companies
|
var planDistribution = companies
|
||||||
.Where(c => !c.IsComped &&
|
.Where(c => !c.IsComped &&
|
||||||
|
!string.IsNullOrEmpty(c.StripeSubscriptionId) &&
|
||||||
(c.SubscriptionStatus == SubscriptionStatus.Active ||
|
(c.SubscriptionStatus == SubscriptionStatus.Active ||
|
||||||
c.SubscriptionStatus == SubscriptionStatus.GracePeriod))
|
c.SubscriptionStatus == SubscriptionStatus.GracePeriod))
|
||||||
.GroupBy(c => c.SubscriptionPlan)
|
.GroupBy(c => c.SubscriptionPlan)
|
||||||
@@ -137,6 +139,7 @@ public class RevenueController : Controller
|
|||||||
var activeInMonth = companies
|
var activeInMonth = companies
|
||||||
.Where(c =>
|
.Where(c =>
|
||||||
!c.IsComped &&
|
!c.IsComped &&
|
||||||
|
!string.IsNullOrEmpty(c.StripeSubscriptionId) &&
|
||||||
c.CreatedAt < monthEnd &&
|
c.CreatedAt < monthEnd &&
|
||||||
(c.SubscriptionStatus == SubscriptionStatus.Active ||
|
(c.SubscriptionStatus == SubscriptionStatus.Active ||
|
||||||
c.SubscriptionStatus == SubscriptionStatus.GracePeriod ||
|
c.SubscriptionStatus == SubscriptionStatus.GracePeriod ||
|
||||||
|
|||||||
Reference in New Issue
Block a user