forked from syntaxbullet/AuroraBot-discord
feat: centralized constants and enums for project-wide use
This commit is contained in:
@@ -7,6 +7,7 @@ import { config } from "@/lib/config";
|
||||
import { UserError } from "@/lib/errors";
|
||||
import { withTransaction } from "@/lib/db";
|
||||
import type { Transaction, ItemUsageData } from "@/lib/types";
|
||||
import { TransactionType } from "@/lib/constants";
|
||||
|
||||
|
||||
|
||||
@@ -121,7 +122,7 @@ export const inventoryService = {
|
||||
const totalPrice = item.price * quantity;
|
||||
|
||||
// Deduct Balance using economy service (passing tx ensures atomicity)
|
||||
await economyService.modifyUserBalance(userId, -totalPrice, 'PURCHASE', `Bought ${quantity}x ${item.name}`, null, txFn);
|
||||
await economyService.modifyUserBalance(userId, -totalPrice, TransactionType.PURCHASE, `Bought ${quantity}x ${item.name}`, null, txFn);
|
||||
|
||||
await inventoryService.addItem(userId, itemId, quantity, txFn);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user