-
Notifications
You must be signed in to change notification settings - Fork 0
Add mutation to delete user #712
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds the ability to delete users through a new GraphQL mutation. The implementation follows the established patterns in the codebase for delete operations, including permission checks, audit logging, and proper error handling.
- Implements
usersDeleteGraphQL mutation with proper authorization (admin-only) - Creates
Users::DeleteServiceto handle the deletion business logic - Adds comprehensive test coverage for both service and GraphQL layers
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
app/graphql/mutations/users/delete.rb |
New GraphQL mutation for deleting users with validation and error handling |
app/services/users/delete_service.rb |
Service class implementing user deletion logic with permission checks and audit logging |
app/policies/user_policy.rb |
Adds :delete_user permission to admin policy |
app/models/audit_event.rb |
Registers :user_deleted audit event type |
app/graphql/types/mutation_type.rb |
Mounts the new Mutations::Users::Delete mutation |
spec/services/users/delete_service_spec.rb |
Service-level tests for user deletion with permission checks |
spec/graphql/mutations/users/delete_spec.rb |
Unit tests for GraphQL mutation naming |
spec/requests/graphql/mutation/users/delete_spec.rb |
Integration tests for the mutation endpoint |
docs/graphql/mutation/usersdelete.md |
API documentation for the new mutation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cf7a5f9 to
20cebaa
Compare
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173850855 Status: Passed Job summariesrspec: [ee]Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183907460/artifacts/tmp/coverage/index.html rspec: [ce]Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183907459/artifacts/tmp/coverage/index.html rubocop688 files inspected, no offenses detected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
close #694