syntaxbullet
5863418ae9
refactor: replace dynamic imports with event bus pattern
...
Replace 12 dynamic `await import()` calls with domain events emitted
through the existing systemEvents bus, breaking circular dependencies
between services (economy/inventory/leveling -> quest, * -> dashboard).
- Add `emitAsync` to SystemEventEmitter for sequential listener awaiting,
preserving DB transaction atomicity for quest progress tracking
- Add DOMAIN event constants (BALANCE_CHANGED, XP_GAINED, ITEM_COLLECTED,
ITEM_USED, TRANSFER_COMPLETED, DAILY_CLAIMED, TRIVIA_*, EXAM_PASSED)
- Create shared/lib/eventWiring.ts to register all domain event listeners
- Convert quest event calls to `await systemEvents.emitAsync()` (5 calls)
- Convert dashboard event calls to `systemEvents.emit()` fire-and-forget (5 calls)
- Convert exam.service.ts userService import to static import (1 call)
- Convert dashboard.service.ts events import to static import (1 call)
- Leave inventory.service.ts validateAndExecuteEffect import unchanged (Task 3)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-18 12:59:15 +01:00
syntaxbullet
a96c6caa49
fix: standardize error classes in shared service modules
...
Replace raw `Error` with `UserError` for user-facing conditions (invalid trade state, user not found, permission/channel type checks) and `SystemError` for internal failures (DB insert failures, external API errors, missing config). Improves Discord UX by ensuring user-facing errors are surfaced cleanly via withCommandErrorHandling.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-18 12:51:16 +01:00
syntaxbullet
2d35a5eabb
feat: Introduce TimerKey enum and refactor timer key usage across services with new tests.
Deploy to Production / test (push) Failing after 27s
2026-02-13 13:11:16 +01:00
syntaxbullet
52f8ab11f0
feat: Implement quest event handling and integrate it into leveling, economy, and inventory services.
2026-01-15 15:04:50 +01:00
syntaxbullet
915f1bc4ad
fix(economy): improve daily cooldown message and consolidate UserError class
2026-01-14 16:26:27 +01:00
syntaxbullet
3f3a6c88e8
fix(dash): resolve test regressions, await promises, and improve TypeScript strictness
2026-01-08 21:12:41 +01:00
syntaxbullet
1251df286e
feat: implement real-time dashboard updates via WebSockets
2026-01-08 21:01:33 +01:00
syntaxbullet
017f5ad818
refactor: fix stale imports
2026-01-08 16:39:34 +01:00
syntaxbullet
88b266f81b
refactor: initial moves
2026-01-08 16:09:26 +01:00