-
Notifications
You must be signed in to change notification settings - Fork 0
Add mutation for creating users #715
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 a GraphQL mutation for admin users to create new user accounts in the system. The implementation includes service layer logic with proper authorization, validation, and audit logging.
- Implements
usersCreatemutation with password confirmation validation - Adds service layer with admin-only authorization and comprehensive error handling
- Introduces audit event logging for user creation actions
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
app/graphql/mutations/users/create.rb |
Defines the GraphQL mutation with input validation and password repeat check |
app/services/users/create_service.rb |
Service layer implementation with authorization, user creation, and audit logging |
app/graphql/types/mutation_type.rb |
Registers the new mutation in the GraphQL schema |
app/policies/global_policy.rb |
Adds create_user permission for admin users |
app/models/audit_event.rb |
Adds user_created action type to audit event enum |
spec/graphql/mutation/users/create_spec.rb |
GraphQL mutation tests covering admin/non-admin scenarios and validation |
spec/services/users/create_service_spec.rb |
Service layer tests covering authentication and validation scenarios |
docs/graphql/mutation/userscreate.md |
API documentation for the new mutation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f2934d4 to
61321fd
Compare
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173862387 Status: Passed Job summariesrspec: [ee]Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183960616/artifacts/tmp/coverage/index.html rspec: [ce]Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183960615/artifacts/tmp/coverage/index.html rubocop687 files inspected, no offenses detected |
61321fd to
49dcb2b
Compare
close #693