feat: Implement userService.getOrCreateUser and integrate it across commands, remove old utility scripts, and fix daily bonus calculation.

This commit is contained in:
syntaxbullet
2025-12-08 10:29:40 +01:00
parent 29c0a4752d
commit 866cfab03e
12 changed files with 42 additions and 94 deletions

View File

@@ -1,7 +1,6 @@
import { users, transactions, cooldowns } from "@/db/schema";
import { eq, sql, and, gt } from "drizzle-orm";
import { eq, sql, and } from "drizzle-orm";
import { DrizzleClient } from "@/lib/DrizzleClient";
import { userService } from "@/modules/user/user.service";
const DAILY_REWARD_AMOUNT = 100n;
const STREAK_BONUS = 10n;
@@ -113,7 +112,7 @@ export const economyService = {
streak = 1;
}
const bonus = BigInt(streak) * STREAK_BONUS;
const bonus = (BigInt(streak) - 1n) * STREAK_BONUS;
const totalReward = DAILY_REWARD_AMOUNT + bonus;