Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/api/src/routes/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7874,7 +7874,10 @@ admin.openapi(getDevpassSubscribers, async (c) => {
const [countRow] = await countSelect.where(whereClause);
const total = Number(countRow?.count ?? 0);

// KPI strip — always over the full active subscriber base, unfiltered
// KPI strip — always over the full active subscriber base, unfiltered.
// Matches Stripe's "active" filter, which includes cancel-at-period-end
// subscriptions until the period actually ends. The `cancelledPending`
// count below breaks out how many of these are flagged to cancel.
const activeRows = await db
.select({
tier: tables.organization.devPlan,
Expand All @@ -7884,7 +7887,6 @@ admin.openapi(getDevpassSubscribers, async (c) => {
.where(
and(
ne(tables.organization.devPlan, "none"),
eq(tables.organization.devPlanCancelled, false),
or(
isNull(tables.organization.devPlanExpiresAt),
sql`${tables.organization.devPlanExpiresAt} > NOW()`,
Expand Down
Loading
Loading