You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users are the foundation for authentication, ownership, and RBAC. The frontend already has a users page and calls these endpoints.
API contract: the frontend already calls these endpoints — see frontend/lib/api/ and frontend/lib/query/keys.ts. Match the paths exactly so the existing UI works without changes.
GET /users list (paginated, searchable)
GET /users/me current user profile
PATCH /users/${id}/role change a user's role
Tasks
Create the User entity: id, email (unique), passwordHash, firstName, lastName, role, departmentId, avatarUrl, isActive, lastLoginAt, timestamps.
Build module, service, and controller with full CRUD plus the endpoints above.
Hash passwords with bcrypt; never return passwordHash in any response (use a serializer or explicit select).
Add search and filtering by name, email, role, department, and active status.
Add deactivate/reactivate rather than hard delete, so historical asset assignments stay intact.
Generate a migration and write unit tests.
Acceptance Criteria
All three endpoints above work and match the frontend's expectations.
Password hashes never appear in a response (asserted by a test).
A user cannot change their own role through the profile update path.
Dependencies
Foundation from [BE-75]; RBAC roles from [BE-81].
Notes for Contributors
The backend is being rebuilt from a clean NestJS skeleton — backend/src/ currently contains only app.module.ts, app.controller.ts, app.service.ts, and main.ts. Follow standard NestJS module structure (module / controller / service / dto / entities) and register your module in app.module.ts. Comment below to be assigned.
Overview
Users are the foundation for authentication, ownership, and RBAC. The frontend already has a users page and calls these endpoints.
Tasks
Userentity: id, email (unique), passwordHash, firstName, lastName, role, departmentId, avatarUrl, isActive, lastLoginAt, timestamps.passwordHashin any response (use a serializer or explicit select).Acceptance Criteria
Dependencies
Foundation from [BE-75]; RBAC roles from [BE-81].
Notes for Contributors
The backend is being rebuilt from a clean NestJS skeleton —
backend/src/currently contains onlyapp.module.ts,app.controller.ts,app.service.ts, andmain.ts. Follow standard NestJS module structure (module/controller/service/dto/entities) and register your module inapp.module.ts. Comment below to be assigned.