Some checks failed
Deploy to Production / test (push) Failing after 33s
- Rewrite AGENTS and README files to match the current app layout - Document API routes, trivia UI, and the active panel design language
33 lines
821 B
Markdown
33 lines
821 B
Markdown
# Quest module
|
|
|
|
## Model
|
|
|
|
- quests are event-driven
|
|
- user progress is stored in `user_quests`
|
|
- completion is automatic once progress reaches the quest target
|
|
|
|
## Main methods
|
|
|
|
- `assignQuest()`
|
|
- `updateProgress()`
|
|
- `handleEvent()`
|
|
- `completeQuest()`
|
|
- `getUserQuests()`
|
|
- `getAvailableQuests()`
|
|
- `createQuest()`
|
|
- `getAllQuests()`
|
|
- `deleteQuest()`
|
|
- `updateQuest()`
|
|
|
|
## Rules
|
|
|
|
- max active quests comes from `gameSettingsService`
|
|
- `assignQuest()` uses `onConflictDoNothing()`
|
|
- `handleEvent()` matches either exact trigger names or `trigger:` prefixes, for example `ITEM_COLLECTED:42`
|
|
- rewards can include balance and XP and are paid inside the completion transaction
|
|
|
|
## Notes
|
|
|
|
- completed assignments remain in `user_quests`
|
|
- `EVENTS.QUEST.COMPLETED` is emitted for the bot/UI layer after reward distribution
|