Skip to content

Commit 3f19076

Browse files
committed
fix tests
1 parent 3243feb commit 3f19076

5 files changed

Lines changed: 8 additions & 28 deletions

File tree

apps/sim/app/api/v1/admin/types.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,6 @@ interface AdminUserBilling {
574574
userEmail: string
575575
stripeCustomerId: string | null
576576
// Usage stats
577-
totalManualExecutions: number
578-
totalApiCalls: number
579-
totalWebhookTriggers: number
580-
totalScheduledExecutions: number
581-
totalChatExecutions: number
582-
totalMcpExecutions: number
583-
totalA2aExecutions: number
584-
totalTokensUsed: number
585577
totalCost: string
586578
currentUsageLimit: string | null
587579
currentPeriodCost: string

apps/sim/app/api/v1/admin/users/[id]/billing/route.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,6 @@ export const GET = withRouteHandler(
107107
userName: userData.name,
108108
userEmail: userData.email,
109109
stripeCustomerId: userData.stripeCustomerId,
110-
totalManualExecutions: stats?.totalManualExecutions ?? 0,
111-
totalApiCalls: stats?.totalApiCalls ?? 0,
112-
totalWebhookTriggers: stats?.totalWebhookTriggers ?? 0,
113-
totalScheduledExecutions: stats?.totalScheduledExecutions ?? 0,
114-
totalChatExecutions: stats?.totalChatExecutions ?? 0,
115-
totalMcpExecutions: stats?.totalMcpExecutions ?? 0,
116-
totalA2aExecutions: stats?.totalA2aExecutions ?? 0,
117-
totalTokensUsed: stats?.totalTokensUsed ?? 0,
118110
totalCost: stats?.totalCost ?? '0',
119111
currentUsageLimit: stats?.currentUsageLimit ?? null,
120112
currentPeriodCost: stats?.currentPeriodCost ?? '0',

apps/sim/lib/api/contracts/v1/admin/users.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ export const adminV1UserBillingSchema = z.object({
2323
userName: z.string(),
2424
userEmail: z.string(),
2525
stripeCustomerId: z.string().nullable(),
26-
totalManualExecutions: z.number(),
27-
totalApiCalls: z.number(),
28-
totalWebhookTriggers: z.number(),
29-
totalScheduledExecutions: z.number(),
30-
totalChatExecutions: z.number(),
31-
totalMcpExecutions: z.number(),
32-
totalA2aExecutions: z.number(),
33-
totalTokensUsed: z.number(),
3426
totalCost: z.string(),
3527
currentUsageLimit: z.string().nullable(),
3628
currentPeriodCost: z.string(),

apps/sim/lib/logs/execution/trace-store.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ export async function externalizeExecutionData(
104104
requireDurable: true,
105105
})
106106

107-
const slim: Record<string, unknown> = { [TRACE_STORE_REF_KEY]: ref }
107+
const { preview: _preview, ...slimRef } = ref
108+
109+
const slim: Record<string, unknown> = { [TRACE_STORE_REF_KEY]: slimRef }
108110
for (const key of INLINE_MARKER_KEYS) {
109111
if (key in executionData) slim[key] = executionData[key]
110112
}

packages/db/schema.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,13 @@ export const userStats = pgTable('user_stats', {
909909
.references(() => user.id, { onDelete: 'cascade' })
910910
.unique(), // One record per user
911911
/**
912-
* Deprecated former usage hot-path counters.
912+
* Retired usage hot-path counters.
913913
*
914914
* These used to be incremented from execution/API/trigger/chat/MCP/A2A
915-
* billing paths on every usage event. New usage reporting must derive
916-
* these dimensions from `usage_log` instead of writing this row.
915+
* billing paths on every usage event. They now have NO writers and NO
916+
* readers (the admin billing surface stopped exposing them) — usage
917+
* dimensions derive from `usage_log` instead. Retained only to defer a
918+
* destructive drop; remove via `DROP COLUMN` in a follow-up migration.
917919
*/
918920
totalManualExecutions: integer('total_manual_executions').notNull().default(0),
919921
totalApiCalls: integer('total_api_calls').notNull().default(0),

0 commit comments

Comments
 (0)