Skip to content

Conversation

@Oguntayo
Copy link

@Oguntayo Oguntayo commented Mar 2, 2025

Description

This PR introduces an endpoint that allows a super admin to deactivate a user account by their user ID. It ensures that only super admins can perform this action and sends a notification email to the deactivated user.

Related Issue

#1031

Motivation and Context

This change is necessary to allow super admins to manage user accounts effectively, ensuring inactive users are properly handled. It improves security and account management within the system.

How Has This Been Tested?

  • Manually tested using Postman by sending a POST request to /api/v1/users/deactivate with valid and invalid user IDs.
  • Verified that only super admins can perform this action.
  • Ensured that already deactivated users cannot be deactivated again.
  • Confirmed that a notification email is sent to the user upon deactivation.
  • Ran unit tests to validate the logic.

Screenshots (if applicable)

sunday4
sunday3
sunday2
sunday1
passed

Types of Changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project.
  • My change does not require updates to the documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests 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.

1 participant