Skip to content

feat(user): implement User entity, CRUD operations, Swagger docs, and tests#373

Merged
BigBen-7 merged 4 commits into
Lead-Studios:dev-v1from
phertyameen:usersModule
Sep 25, 2025
Merged

feat(user): implement User entity, CRUD operations, Swagger docs, and tests#373
BigBen-7 merged 4 commits into
Lead-Studios:dev-v1from
phertyameen:usersModule

Conversation

@phertyameen

Copy link
Copy Markdown
Contributor

Description

This PR introduces the core User module with full CRUD functionality, validation, API documentation, and unit tests.

Related Issues

Closes #365

Changes Made

  • Defined User entity with id, email, passwordHash, role, and createdAt fields.

  • Implemented UserService with CRUD operations and secure password hashing using bcrypt.

  • Created UserController exposing the following endpoints:

    • GET /users → fetch all users
    • POST /users → create new user (password auto-hashed)
    • PATCH /users/:id → update user details (rehash password if changed)
    • DELETE /users/:id → delete user
  • Added DTOs (CreateUserDto, UpdateUserDto) with validation and Swagger decorators.

  • Enhanced controller with Swagger documentation decorators for clear API docs.

  • Added unit tests for both service and controller using Jest.

How to Test

Screenshots (if applicable)

Checklist

  • My code follows the project's coding style.
  • I have tested these changes locally.
  • Documentation has been updated where necessary.
  • Users can be created, retrieved, updated, and deleted via API.
  • Passwords are hashed before storage.
  • API documentation is available via Swagger.
  • Unit tests validate core functionality.

BigBen-7 and others added 4 commits September 25, 2025 09:33
…related DTOs

- Deleted SpecialGuestModule and its related files.
- Removed Ticket module, including TicketService, TicketController, and all associated entities and DTOs.
- Eliminated User module, including UserService, UserController, and all related entities and DTOs.
- Updated tsconfig.json to use nodenext module resolution.

@BigBen-7 BigBen-7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BigBen-7 BigBen-7 merged commit cd2a223 into Lead-Studios:dev-v1 Sep 25, 2025
1 check passed
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.

2 participants