Merged
Conversation
|
@shamoo53 is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
yusuftomilola
approved these changes
Oct 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Implement Standalone User Module
Overview
This PR introduces a standalone User module into the system, providing complete management of system users. The module is built using NestJS + TypeORM, includes input validation with
class-validator, and ensures password security by hashing values before storage. It also provides RESTful APIs for creating, retrieving, updating, and deleting users, as well as mapping users to companies, departments, and branches.Key Features
Database Entity:
New
Userentity with fields:id(UUID, primary key)fullName(string, required)email(unique, required)phoneNumber(optional, string)passwordHash(string, hashed value of password)role(enum/string)DTOs & Validation:
CreateUserDtowith validation for required fields (email format, password length, etc.)UpdateUserDtosupporting partial updates with validation rulesService Layer:
createUser: Creates a new user with hashed passwordfindAllUsers: Returns a list of usersfindOneUser: Retrieves a user byidupdateUser: Updates user details (supports role, name, etc.)deleteUser: Removes a user byidController Endpoints:
POST /users→ Create new userGET /users→ Fetch all usersGET /users/:id→ Fetch user by IDPATCH /users/:id→ Update userDELETE /users/:id→ Delete userPassword Security:
Tests
Added integration tests for all endpoints:
Validations tested (e.g., invalid email, short password)
Next Steps / Future Enhancements
✅ This PR lays the foundation for user management across the system and ensures all user data is stored securely.