fix: wire quest progress tracking for transfer, daily, trivia, and exam events
Some checks failed
Deploy to Production / test (push) Failing after 31s
Some checks failed
Deploy to Production / test (push) Failing after 31s
These domain events were only connected to dashboard recording but never called questService.handleEvent(), so quests with triggers TRANSFER_OUT, DAILY_REWARD, TRIVIA_WIN, and EXAM_REWARD never tracked progress. Added userId and tx to event payloads and switched from emit to emitAsync for transaction atomicity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@ export const economyService = {
|
||||
});
|
||||
|
||||
// Record dashboard event
|
||||
systemEvents.emit(EVENTS.DOMAIN.TRANSFER_COMPLETED, { username: sender.username, amount, toUserId });
|
||||
await systemEvents.emitAsync(EVENTS.DOMAIN.TRANSFER_COMPLETED, { userId: fromUserId, username: sender.username, amount, toUserId, tx: txFn });
|
||||
|
||||
return { success: true, amount };
|
||||
}, tx);
|
||||
@@ -158,7 +158,7 @@ export const economyService = {
|
||||
});
|
||||
|
||||
// Record dashboard event
|
||||
systemEvents.emit(EVENTS.DOMAIN.DAILY_CLAIMED, { username: user.username, amount: totalReward });
|
||||
await systemEvents.emitAsync(EVENTS.DOMAIN.DAILY_CLAIMED, { userId, username: user.username, amount: totalReward, tx: txFn });
|
||||
|
||||
return { claimed: true, amount: totalReward, streak, nextReadyAt, isWeekly: isWeeklyCurrent, weeklyBonus: weeklyBonusAmount };
|
||||
}, tx);
|
||||
|
||||
@@ -243,7 +243,7 @@ export const examService = {
|
||||
}
|
||||
|
||||
// Record dashboard event
|
||||
systemEvents.emit(EVENTS.DOMAIN.EXAM_PASSED, { username: user.username, reward });
|
||||
await systemEvents.emitAsync(EVENTS.DOMAIN.EXAM_PASSED, { userId, username: user.username, reward, tx: txFn });
|
||||
|
||||
return {
|
||||
status: ExamStatus.AVAILABLE,
|
||||
|
||||
Reference in New Issue
Block a user