mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-07 22:24:06 -05:00
feat(cost): added hidden cost breakdown component to settings > subscription, start collecting current period copilot cost and last period copilot cost (#1770)
* feat(cost): added hidden cost breakdown component to settings > subscription, start collecting current period copilot cost and last period copilot cost * don't rerender envvars when switching between workflows in the same workspace
This commit is contained in:
2
packages/db/migrations/0103_careful_harpoon.sql
Normal file
2
packages/db/migrations/0103_careful_harpoon.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "user_stats" ADD COLUMN "current_period_copilot_cost" numeric DEFAULT '0' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "user_stats" ADD COLUMN "last_period_copilot_cost" numeric DEFAULT '0';
|
||||
7264
packages/db/migrations/meta/0103_snapshot.json
Normal file
7264
packages/db/migrations/meta/0103_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -715,6 +715,13 @@
|
||||
"when": 1761769369858,
|
||||
"tag": "0102_eminent_amphibian",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 103,
|
||||
"version": "7",
|
||||
"when": 1761845605676,
|
||||
"tag": "0103_careful_harpoon",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -571,6 +571,8 @@ export const userStats = pgTable('user_stats', {
|
||||
proPeriodCostSnapshot: decimal('pro_period_cost_snapshot').default('0'), // Snapshot of Pro usage when joining team
|
||||
// Copilot usage tracking
|
||||
totalCopilotCost: decimal('total_copilot_cost').notNull().default('0'),
|
||||
currentPeriodCopilotCost: decimal('current_period_copilot_cost').notNull().default('0'),
|
||||
lastPeriodCopilotCost: decimal('last_period_copilot_cost').default('0'),
|
||||
totalCopilotTokens: integer('total_copilot_tokens').notNull().default(0),
|
||||
totalCopilotCalls: integer('total_copilot_calls').notNull().default(0),
|
||||
// Storage tracking (for free/pro users)
|
||||
|
||||
Reference in New Issue
Block a user