feat(economy): tighten credit earning + deduct on request

Credit economy changes:
- creditsPerMinute: 10 -> 2 (45min episode = 90 COOP vs 450)
- movieRequestCost: 100 -> 500 (~5.5 episodes per movie)
- tvRequestCost: 200 -> 1000 (~11 episodes per season)
- tvPerSeasonCost: 50 -> 250

Race condition fix:
- Credits now deducted immediately at request time
- No more multiple requests before approval
- On DECLINED: automatic refund with ADJUSTMENT transaction
- On APPROVED: no extra deduction (already paid)

Updated schema defaults and all code fallbacks.
This commit is contained in:
2026-04-21 15:50:18 -04:00
parent fee4d8ce1b
commit 86a8c7d89a
4 changed files with 230 additions and 203 deletions
+4 -4
View File
@@ -152,14 +152,14 @@ model SystemSettings {
id String @id @default(cuid())
// Minting settings
creditsPerMinute Int @default(10) @map("credits_per_minute")
creditsPerMinute Int @default(2) @map("credits_per_minute")
minWatchPercent Int @default(80) @map("min_watch_percent")
minWatchMinutes Int @default(5) @map("min_watch_minutes")
// Spending settings
movieRequestCost Int @default(100) @map("movie_request_cost")
tvRequestCost Int @default(200) @map("tv_request_cost")
tvPerSeasonCost Int @default(50) @map("tv_per_season_cost")
movieRequestCost Int @default(500) @map("movie_request_cost")
tvRequestCost Int @default(1000) @map("tv_request_cost")
tvPerSeasonCost Int @default(250) @map("tv_per_season_cost")
// Multipliers
newReleaseMultiplier Decimal @default(1.5) @map("new_release_multiplier") @db.Decimal(3, 2)