forked from Code-4-Community/scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description: In users.service.ts there are two methods, findOne and findUserById. They do the same thing, except there is authentication logic in findOne. This is an example of deprecated and duplicate code, which is bad (violates single responsibility principle). To clean this up, remove all instances of findOne and replace it with findUserById. Additionally, extract the user authentication (admin vs applicant, etc.) logic from findOne and move it into the controller layer. Update tests as needed.
Acceptance Criteria:
- All calls to findOne are replaced with findUserById
- Authentication logic (admin vs applicant checks) is moved from service layer to controller layer
- All existing tests are updated to reflect the changes → service layer tests for user authentication (ex: user.status == ADMIN) are removed
Effort Estimate:
- T-shirt size: M
Metadata
Metadata
Assignees
Labels
No labels