What: Add an endpoint that returns the user's achievements (badges earned, milestones reached, streaks).
Why: Gamification elements like achievements and badges drive engagement. Users need to see their accomplishments beyond just credits and credentials.
Scope: Create achievements table with user_id, type, name, description, earned_at. Define achievement types: first_enrollment, first_quiz, first_credential, course_streak (3+ courses), perfect_score (100% on quiz). Check and award achievements after relevant actions.
Acceptance criteria:
- Achievements are awarded automatically after qualifying actions
- User can view all earned achievements
- Achievement definitions are configurable
- New achievements trigger a notification
Technical context: src/modules/users/user.service.ts — user operations. src/database/schema.ts — schema definitions.
What: Add an endpoint that returns the user's achievements (badges earned, milestones reached, streaks).
Why: Gamification elements like achievements and badges drive engagement. Users need to see their accomplishments beyond just credits and credentials.
Scope: Create
achievementstable with user_id, type, name, description, earned_at. Define achievement types: first_enrollment, first_quiz, first_credential, course_streak (3+ courses), perfect_score (100% on quiz). Check and award achievements after relevant actions.Acceptance criteria:
Technical context:
src/modules/users/user.service.ts— user operations.src/database/schema.ts— schema definitions.