feat: implement branded discord embeds and versioning

This commit is contained in:
syntaxbullet
2026-01-14 16:10:23 +01:00
parent 6e57ab07e4
commit 4af2690bab
13 changed files with 291 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
### Context & Goal
The `exam` command currently contains a lot of business logic, including reward calculations, timer management, and complex database transactions. Moving this logic to a dedicated `ExamService` will improve testability, maintainability, and keep the command file focused on user interaction.
### Dependencies
- None
### Affected Files
- `shared/modules/economy/exam.service.ts`: New file for the exam logic.
- `bot/commands/economy/exam.ts`: Refactor to use the new service.
### Technical Constraints & Strategy
- Implementation: Create an `ExamService` that handles `getExamStatus`, `takeExam`, and `registerForExam`.
- The command should only handle user input and formatting the response embeds based on the service's result.
- Ensure the Drizzle transactions are correctly handled within the service.
### Definition of Done (Binary)
- [ ] `ExamService` implemented with methods for all exam-related operations.
- [ ] `bot/commands/economy/exam.ts` refactored to use the service.
- [ ] Logic is covered by unit tests in a new test file.
- [ ] Manual verification shows the exam command still works as expected.
### New Test Files
- `shared/modules/economy/exam.service.test.ts`: Unit tests for reward calculations and state transitions.