fix: wire quest progress tracking for transfer, daily, trivia, and exam events
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:
syntaxbullet
2026-03-28 15:24:30 +01:00
parent 3edda1d707
commit 1d601febcf
5 changed files with 24 additions and 8 deletions

View File

@@ -289,7 +289,7 @@ class TriviaService {
where: eq(users.id, BigInt(userId))
});
systemEvents.emit(EVENTS.DOMAIN.TRIVIA_WON, { username: user?.username, reward });
await systemEvents.emitAsync(EVENTS.DOMAIN.TRIVIA_WON, { userId, username: user?.username, reward, tx });
});
}