feat: Added XP and level tracking to users#212
feat: Added XP and level tracking to users#212phertyameen merged 14 commits intoMindBlockLabs:mainfrom
Conversation
|
@phertyameen 👋🙂. Patiently waiting for your review. |
|
@phertyameen . still waiting patiently for your review🙂 |
phertyameen
left a comment
There was a problem hiding this comment.
Nice and clean. Just remove the file .\xp-level-test.ps1 and your pr is ready to merge. Tag me when you do'
|
@phertyameen 🫡. i am done with the changes you requested. |
|
@phertyameen 🫡 GM GM, waiting very patiently for your review. okay let me not overemphasize , but you get the Point 😁 |
|
@devchant I hear you. Please checkout CONTRIBUTING.md for build test to fic build/cicd errors |
…k_app into XP-Level-Tracking
|
@phertyameen thank you so much for the patience. current done fixing pipeline |
|
@phertyameen . 🙂 Patiently waiting for your review boss. |
phertyameen
left a comment
There was a problem hiding this comment.
I see alot of file changes with every commit. Hold on a minute! don't push any changes. let me help a little bit.
There was a problem hiding this comment.
Avoid messing with this files configuration in any project in the future!
There was a problem hiding this comment.
Unless your issue explicitly tells you to, avoid this app too
There was a problem hiding this comment.
you were never ment to touch this file. Some lint errors definitly came from here
There was a problem hiding this comment.
Ttouching this is dangerous
| findAll(@Query() query: PuzzleQueryDto) { | ||
| return this.puzzlesService.findAll(query); | ||
| } | ||
|
|
There was a problem hiding this comment.
You are not ment to remove any endpoint
backend/src/roles/roleguard.spec.ts
Outdated
fixex fixes
0675f89 to
ebc1cdf
Compare
XP and Level Tracking System Implementation
Closes #99
This PR implements a comprehensive XP and Level tracking system for users. The core logic is encapsulated in a new
XpLevelService(src/users/providers/xp-level.service.ts), which calculates levels using the rule 500 XP = 1 Level (Math.floor(xp / 500) + 1) and tracksxp,level, andnextLevel(XP remaining until the next level). A new API endpointGET /users/:id/xp-levelhas been added to theUsersController, returning user progression data. Example response:{ "level": 2, "xp": 550, "nextLevel": 1000 }XP is automatically awarded through integration with the puzzle engine via
ProgressCalculationProvider, ensuring gamification is seamless. Unit tests (xp-level.service.spec.ts) verify all core scenarios, including XP accumulation, leveling up, and calculation of the next level threshold, and all tests are passing. Additionally, a bug in theUserentity'sprogressRecordsmapping was fixed, ensuring consistency of progress data.The implementation follows clean architecture principles, consolidating logic within
UsersModuleandProgressModulewhile avoiding circular dependencies. The build passes successfully (npm run build), and these changes are designed to be fully backward-compatible, isolated, and non-breaking for existing workflows.