address greptile review: per-provider deficit notch, startedAt filter, weekRange refresh, deduplicate providerDisplayName

This commit is contained in:
Sai Shankar
2026-03-08 03:35:23 +05:30
committed by Dotta
parent 94018e0239
commit 82bc00a3ae
4 changed files with 36 additions and 42 deletions

View File

@@ -172,8 +172,8 @@ export function costService(db: Db) {
.orderBy(desc(sql`coalesce(sum(${costEvents.costCents}), 0)::int`));
const runConditions: ReturnType<typeof eq>[] = [eq(heartbeatRuns.companyId, companyId)];
if (range?.from) runConditions.push(gte(heartbeatRuns.finishedAt, range.from));
if (range?.to) runConditions.push(lte(heartbeatRuns.finishedAt, range.to));
if (range?.from) runConditions.push(gte(heartbeatRuns.startedAt, range.from));
if (range?.to) runConditions.push(lte(heartbeatRuns.startedAt, range.to));
const runRows = await db
.select({