feat: implement real-time dashboard updates via WebSockets

This commit is contained in:
syntaxbullet
2026-01-08 21:01:33 +01:00
parent fff90804c0
commit 1251df286e
7 changed files with 267 additions and 73 deletions

View File

@@ -61,6 +61,14 @@ export const economyService = {
description: `Transfer from ${fromUserId}`,
});
// Record dashboard event
const { dashboardService } = await import("@shared/modules/dashboard/dashboard.service");
dashboardService.recordEvent({
type: 'info',
message: `${sender.username} transferred ${amount.toLocaleString()} AU to User ID ${toUserId}`,
icon: '💸'
});
return { success: true, amount };
}, tx);
},
@@ -149,6 +157,14 @@ export const economyService = {
description: `Daily reward (Streak: ${streak})`,
});
// Record dashboard event
const { dashboardService } = await import("@shared/modules/dashboard/dashboard.service");
dashboardService.recordEvent({
type: 'success',
message: `${user.username} claimed daily reward: ${totalReward.toLocaleString()} AU`,
icon: '☀️'
});
return { claimed: true, amount: totalReward, streak, nextReadyAt, isWeekly: isWeeklyCurrent, weeklyBonus: weeklyBonusAmount };
}, tx);
},