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: Add endpoint to delete organization #528

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

max-out-oluwadara
Copy link
Contributor

@max-out-oluwadara max-out-oluwadara commented Aug 8, 2024

Fixes Issue/Linear Ticket

This could be an existing issue or a linear ticket

  • Github Issue Example: My PR Closes #{ISSUE}
  • Linear Ticket Example: Fixes ID-#issue/BBE-52/[feat]-delete-organization

Changes proposed

The purpose of this addition is to provide administrators with the capability to remove organizations that are no longer needed or were created in error. This aligns with our goal of maintaining a clean and efficient database.

Implementation Details

  • Endpoint: DELETE /api/v1/organizations/:org_id
  • Controller: Added deleteOrganization method to OrgController
  • Service: Added deleteOrganization method to OrgService
  • Validation: Implemented middleware to validate organization ID
  • Routing: Updated orgRouter to include the new delete endpoint
  • Unit Tests: Added tests to cover:
      - Successful deletion of an organization
      - Attempt to delete a non-existent organization
      - Unauthorized access attempts

Talk about the things you did eg. files changes, dependencies installed e.t.c

Check List (Check all the applicable boxes)

🚨Please review the [style guide for contributing](add link here) and [guidelines for contributing](add link here) to this repository.

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Test Cases

  1. Success Case: Delete an existing organization and verify the response.
  2. Invalid Organization ID: Attempt to delete an organization with an invalid or non-existent ID and verify the error response.
  3. Unauthorized Access: Attempt to delete an organization without proper permissions and verify the access denial.

Screenshots/ Videos

@max-out-oluwadara
Copy link
Contributor Author

@thectogeneral pls review and merge

@thectogeneral
Copy link
Contributor

@AdeGneus @Khingz or @PreciousIfeaka are the ones to merge @max-out-oluwadara

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.

4 participants