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

36 Ft admin deactivate activate #66

Merged
merged 2 commits into from
May 20, 2024

Conversation

ambroisegithub
Copy link
Contributor

@ambroisegithub ambroisegithub commented May 16, 2024

What does this PR do?

This pull request introduces the ability for platform administrators to deactivate user accounts (both vendors and buyers) on the e-commerce platform. This feature enables admins to temporarily or permanently disable a user's access due to policy violations, suspicious activities, or maintenance purposes.

Description of Task to be completed:

The tasks included in this pull request are as follows:**

  • Implement an API endpoint for account deactivation by the admin.
  • Validate admin's authentication and authorization.
  • Deactivate the user's account by updating the database.
  • Revoke any active sessions or access tokens for the deactivated account.
  • Implement appropriate error handling and responses.
  • Implement input sanitization.

Developer Notes:

Here are some additional notes for developers working on this feature:

  • Define the API endpoint and request/response payloads for account deactivation.
  • Implement authentication and authorization checks for admin access.
  • Update the user account status in the database to indicate deactivation.
  • Revoke any active sessions or access tokens associated with the deactivated account.
  • Handle edge cases, such as failed deactivation or unauthorized access.
  • Write unit tests to cover different scenarios and edge cases.
  • Write clear API documentation for the resulting endpoint.

Related Issues:

#46

Definition of Done:

To consider this task complete, the following criteria must be met:

  • Account deactivation API endpoint is implemented and functional.
  • Admin authentication and authorization are validated.
  • User accounts are deactivated by updating the database.
  • Active sessions or access tokens for deactivated accounts are revoked.
  • Appropriate error handling and responses are implemented.
  • Input sanitization measures are in place.
  • Unit tests are written and passing.
  • Code adheres to coding standards and best practices.
  • API documentation for the resulting endpoint is completed.

@ambroisegithub ambroisegithub requested review from EddyShimwa, jkarenzi, bertrandshema and wayneleon1 and removed request for EddyShimwa May 16, 2024 21:52
@ambroisegithub ambroisegithub self-assigned this May 16, 2024
@ambroisegithub ambroisegithub added the backend Good for newcomers label May 16, 2024
@ambroisegithub ambroisegithub added this to the Authentication & RBAC milestone May 16, 2024
@ambroisegithub ambroisegithub linked an issue May 16, 2024 that may be closed by this pull request
6 tasks
@ambroisegithub ambroisegithub force-pushed the ft-admin-deactivate-activate-#36 branch 14 times, most recently from b184e68 to 8f1421a Compare May 19, 2024 15:53
@ambroisegithub
Copy link
Contributor Author

Screenshot from 2024-05-17 17-48-32

@ambroisegithub
Copy link
Contributor Author

Screenshot from 2024-05-19 18-08-11

wayneleon1
wayneleon1 previously approved these changes May 20, 2024
Copy link
Contributor

@wayneleon1 wayneleon1 left a comment

Choose a reason for hiding this comment

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

Looks Good to me!

@ambroisegithub ambroisegithub force-pushed the ft-admin-deactivate-activate-#36 branch from 30fba24 to b25bd8b Compare May 20, 2024 07:47
jkarenzi
jkarenzi previously approved these changes May 20, 2024
bertrandshema
bertrandshema previously approved these changes May 20, 2024
Copy link
Contributor

@bertrandshema bertrandshema left a comment

Choose a reason for hiding this comment

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

It is all good for mreging.

wayneleon1
wayneleon1 previously approved these changes May 20, 2024
Copy link
Contributor

@wayneleon1 wayneleon1 left a comment

Choose a reason for hiding this comment

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

good job

Copy link
Contributor

@bertrandshema bertrandshema left a comment

Choose a reason for hiding this comment

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

It is good now.

Copy link
Collaborator

@Habinezajanvier Habinezajanvier left a comment

Choose a reason for hiding this comment

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

👍

@Habinezajanvier Habinezajanvier merged commit 0186cbc into develop May 20, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Account Deactivation by Platform Admin
5 participants