Skip to content

feat: verification badge system and profile update history logging#617

Merged
nafiuishaaq merged 1 commit into
MentoNest:mainfrom
Userhorlie:feat/verification-badge-and-profile-history
May 30, 2026
Merged

feat: verification badge system and profile update history logging#617
nafiuishaaq merged 1 commit into
MentoNest:mainfrom
Userhorlie:feat/verification-badge-and-profile-history

Conversation

@Userhorlie
Copy link
Copy Markdown
Contributor

Summary

Implements issues #484 and #485.

#484 — Verification badge system

  • Added isVerified, verifiedAt, verifiedBy, verificationNotes fields to User entity
  • Migration 1763000000000-AddVerificationFieldsToUsers adds the columns to the users table
  • POST /admin/mentors/:id/verify — admin sets isVerified=true with optional notes
  • DELETE /admin/mentors/:id/verify — admin revokes verification
  • Verification status included in all user API responses (entity fields)

#485 — Profile update history logging

  • New ProfileHistory entity: userId, fieldName, oldValue, newValue, changedBy, changeReason, changedAt (ms precision)
  • Migration 1764000000000-CreateProfileHistory creates the append-only profile_history table
  • ProfileHistorySubscriber TypeORM subscriber auto-captures changes to tracked User fields on every update
  • GET /admin/users/:userId/profile-history — paginated history endpoint (admin only)

Tests

  • 9 unit tests passing: AdminService (7) + ProfileHistorySubscriber (4)
  • All endpoints protected by JwtAuthGuard + RolesGuard + @Roles(ADMIN)

Closes #484
Closes #485

- Add isVerified, verifiedAt, verifiedBy, verificationNotes fields to User entity (MentoNest#484)
- Add migration for verification fields on users table (MentoNest#484)
- Create ProfileHistory entity with userId, fieldName, old/new values, changedBy, changeReason, changedAt (MentoNest#485)
- Add migration for profile_history table (MentoNest#485)
- Create ProfileHistorySubscriber to auto-capture User field changes via TypeORM (MentoNest#485)
- Create AdminModule with AdminService and AdminController (MentoNest#484, MentoNest#485)
  - POST /admin/mentors/:id/verify — set isVerified=true (admin only)
  - DELETE /admin/mentors/:id/verify — revoke verification (admin only)
  - GET /admin/users/:userId/profile-history — paginated history (admin only)
- Register AdminModule in AppModule
- Add unit tests: 9 tests passing (AdminService x7, ProfileHistorySubscriber x4)

Closes MentoNest#484
Closes MentoNest#485
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Userhorlie Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

This was referenced May 29, 2026
@nafiuishaaq nafiuishaaq merged commit 5460b30 into MentoNest:main May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile update history logging Verification badge system

2 participants