Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-implement-user-status-update #65

Merged
merged 1 commit into from
May 7, 2024
Merged

Conversation

Calebgisa72
Copy link
Contributor

What does this PR do?
This PR introduces several key features and enhancements to the project with aim to improve user management and security.

Description of Task Completed:

  1. User Activation and Deactivation Functionality:
  • Implemented activateUser and deactivateUser functions to handle user activation and deactivation processes respectively.
  • Utilized an email generator utility with two email templates: one for user activation and another for user deactivation. These templates are invoked within the activateUser and deactivateUser functions to send appropriate emails to users.
  1. Middleware for User Status Restriction:
  • Developed a middleware to restrict actions for users with a suspended status. This middleware ensures that users with a suspended status cannot perform certain actions within the application.
  1. Testing:
  • Comprehensive tests have been written to verify the functionality of activateUser, deactivateUser, and the user status restriction middleware.

How should this be manually tested?

@Calebgisa72 Calebgisa72 linked an issue May 6, 2024 that may be closed by this pull request
6 tasks
@Calebgisa72 Calebgisa72 added the backend Good for newcomers label May 6, 2024
@coveralls
Copy link

coveralls commented May 6, 2024

Pull Request Test Coverage Report for Build 8982474121

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 115 of 133 (86.47%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.6%) to 76.054%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/services/updateUserStatus/activateUserService.ts 21 22 95.45%
src/services/updateUserStatus/deactivateUserService.ts 21 22 95.45%
src/middlewares/isAllowed.ts 16 18 88.89%
src/helper/verify.ts 8 11 72.73%
src/utils/sendStatusMail.ts 21 25 84.0%
src/middlewares/isValid.ts 14 21 66.67%
Totals Coverage Status
Change from base Build 8981330624: 2.6%
Covered Lines: 467
Relevant Lines: 572

💛 - Coveralls

@Calebgisa72 Calebgisa72 self-assigned this May 6, 2024
@Calebgisa72 Calebgisa72 added this to the Authentication and RBAC milestone May 6, 2024
@Calebgisa72 Calebgisa72 force-pushed the ft-update-user-status branch 9 times, most recently from a85f94d to 6677238 Compare May 6, 2024 19:33
@Calebgisa72 Calebgisa72 added the Ready for reviews Pull request is ready for review label May 6, 2024
Copy link
Contributor

@elijahladdie elijahladdie left a comment

Choose a reason for hiding this comment

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

can you rebase with develop please

Copy link
Collaborator

@faid-terence faid-terence left a comment

Choose a reason for hiding this comment

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

Nice Work @Calebgisa72 !

@faid-terence faid-terence merged commit 4617c75 into develop May 7, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Good for newcomers Ready for reviews Pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Account Deactivation by Platform Admin
8 participants