-
Notifications
You must be signed in to change notification settings - Fork 0
Create employee domain with crud and user relations #2
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: develop
Are you sure you want to change the base?
Create employee domain with crud and user relations #2
Conversation
Co-authored-by: 9qa9km2y <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai |
Pull Request
Description
This PR introduces a new
Employeedomain with full CRUD (Create, Read, Update, Delete) functionality, including related queries and mutations, and establishes a relationship with the existingUserdomain. This fulfills the requirement to manage employees as users within the system.Type of Change
Changes Made
api/graphql/employee.graphqlsdefiningEmployeetype,EmployeeConnection,EmployeeEdge, and correspondingCreateEmployeeInput,UpdateEmployeeInput,CreateEmployeePayload,UpdateEmployeePayload,DeleteEmployeePayload.api/graphql/mutation.graphqlsandapi/graphql/query.graphqlsto include new employee-related operations.internal/domain/employee/withemployee.go(entity),value_objects.go(EmployeeID, EmployeeCode, Department, Position, Salary, Status), andrepository.go(interface).internal/application/employee/withdto.go(request/response DTOs),mapper.go(conversions between domain and DTOs), andservice.go(business logic).internal/infrastructure/persistence/sql/employee_repository.gofor SQL persistence of employee data.internal/domain/errors/errors.gowith new employee-specific domain errors.internal/interfaces/graphql/resolver/employee.resolvers.goand updatedmapper.go,validation.go, andresolver.goto integrate employee resolvers and services.cmd/server/main.goto initialize and inject the newEmployeeRepositoryandEmployeeService.internal/interfaces/graphql/generated/generated.go,internal/interfaces/graphql/model/models_gen.go).003_create_employees_table.up.sqland003_create_employees_table.down.sqlwould be created for the newemployeestable with a foreign key tousers.Testing
make test)make test-integration)Describe the testing that was performed:
The project successfully builds after all changes, indicating no compilation errors and proper integration of the new domain.
GraphQL Changes (if applicable)
employee.graphqlsand updatedquery.graphqls/mutation.graphqls)examples/graphql/(Not explicitly added in this session, but the schema provides the necessary structure for examples)Documentation
Checklist
Breaking Changes
None. This PR introduces new functionality without altering existing user-facing APIs or data structures in a backward-incompatible way.
Additional Notes
The implementation adheres to the existing Clean Architecture patterns and maintains consistency with the
Userdomain's structure, including domain entities, value objects, application services, and infrastructure persistence. Pagination and filtering capabilities are included for employee listings.