forked from syntaxbullet/AuroraBot-discord
refactor: convert TradeService to object export pattern
Convert from class-based to object-based export for consistency with other services (economy, inventory, quest, etc). Changes: - Move sessions Map and helper functions to module scope - Convert static methods to object properties - Update executeTrade to use withTransaction helper - Update all imports from TradeService to tradeService Updated files: - trade.service.ts (main refactor) - trade.interaction.ts (update usages) - trade.ts command (update import and usage) All tests passing with no breaking changes.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createCommand } from "@/lib/utils";
|
||||
import { SlashCommandBuilder, ChannelType, ThreadAutoArchiveDuration, MessageFlags } from "discord.js";
|
||||
import { TradeService } from "@/modules/trade/trade.service";
|
||||
import { tradeService } from "@/modules/trade/trade.service";
|
||||
import { getTradeDashboard } from "@/modules/trade/trade.view";
|
||||
import { createErrorEmbed, createWarningEmbed } from "@lib/embeds";
|
||||
|
||||
@@ -59,7 +59,7 @@ export const trade = createCommand({
|
||||
}
|
||||
|
||||
// Setup Session
|
||||
const session = TradeService.createSession(thread.id,
|
||||
const session = tradeService.createSession(thread.id,
|
||||
{ id: interaction.user.id, username: interaction.user.username },
|
||||
{ id: targetUser.id, username: targetUser.username }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user