-
Notifications
You must be signed in to change notification settings - Fork 0
Implement human resource domain and features #3
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
Open
captain-corgi
wants to merge
1
commit into
cursor/create-employee-domain-with-crud-and-user-relations-e465
Choose a base branch
from
cursor/implement-human-resource-domain-and-features-1eb9
base: cursor/create-employee-domain-with-crud-and-user-relations-e465
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Department types and inputs | ||
|
|
||
| type Department { | ||
| id: ID! | ||
| name: String! | ||
| description: String! | ||
| managerId: ID | ||
| createdAt: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| updatedAt: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| } | ||
|
|
||
| type DepartmentConnection { | ||
| edges: [DepartmentEdge!]! | ||
| pageInfo: PageInfo! | ||
| } | ||
|
|
||
| type DepartmentEdge { | ||
| node: Department! | ||
| cursor: String! | ||
| } | ||
|
|
||
| input CreateDepartmentInput { | ||
| name: String! | ||
| description: String! | ||
| managerId: ID | ||
| } | ||
|
|
||
| input UpdateDepartmentInput { | ||
| name: String | ||
| description: String | ||
| managerId: ID | ||
| } | ||
|
|
||
| type CreateDepartmentPayload { | ||
| department: Department! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type UpdateDepartmentPayload { | ||
| department: Department! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type DeleteDepartmentPayload { | ||
| success: Boolean! | ||
| errors: [Error!] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Leave types and inputs | ||
|
|
||
| type Leave { | ||
| id: ID! | ||
| employeeId: ID! | ||
| leaveType: String! | ||
| startDate: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| endDate: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| reason: String! | ||
| status: String! | ||
| approvedBy: ID | ||
| approvedAt: String # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| createdAt: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| updatedAt: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| } | ||
|
|
||
| type LeaveConnection { | ||
| edges: [LeaveEdge!]! | ||
| pageInfo: PageInfo! | ||
| } | ||
|
|
||
| type LeaveEdge { | ||
| node: Leave! | ||
| cursor: String! | ||
| } | ||
|
|
||
| input CreateLeaveInput { | ||
| employeeId: ID! | ||
| leaveType: String! | ||
| startDate: String! | ||
| endDate: String! | ||
| reason: String! | ||
| } | ||
|
|
||
| input UpdateLeaveInput { | ||
| leaveType: String | ||
| startDate: String | ||
| endDate: String | ||
| reason: String | ||
| } | ||
|
|
||
| input ApproveLeaveInput { | ||
| approvedBy: ID! | ||
| } | ||
|
|
||
| type CreateLeavePayload { | ||
| leave: Leave! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type UpdateLeavePayload { | ||
| leave: Leave! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type ApproveLeavePayload { | ||
| leave: Leave! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type RejectLeavePayload { | ||
| leave: Leave! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type CancelLeavePayload { | ||
| leave: Leave! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type DeleteLeavePayload { | ||
| success: Boolean! | ||
| errors: [Error!] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Position types and inputs | ||
|
|
||
| type Position { | ||
| id: ID! | ||
| title: String! | ||
| description: String! | ||
| departmentId: ID | ||
| requirements: String! | ||
| minSalary: Float! | ||
| maxSalary: Float! | ||
| createdAt: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| updatedAt: String! # TODO: Change to Time scalar when custom scalar marshaling is implemented | ||
| } | ||
|
|
||
| type PositionConnection { | ||
| edges: [PositionEdge!]! | ||
| pageInfo: PageInfo! | ||
| } | ||
|
|
||
| type PositionEdge { | ||
| node: Position! | ||
| cursor: String! | ||
| } | ||
|
|
||
| input CreatePositionInput { | ||
| title: String! | ||
| description: String! | ||
| departmentId: ID | ||
| requirements: String! | ||
| minSalary: Float! | ||
| maxSalary: Float! | ||
| } | ||
|
|
||
| input UpdatePositionInput { | ||
| title: String | ||
| description: String | ||
| departmentId: ID | ||
| requirements: String | ||
| minSalary: Float | ||
| maxSalary: Float | ||
| } | ||
|
|
||
| type CreatePositionPayload { | ||
| position: Position! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type UpdatePositionPayload { | ||
| position: Position! | ||
| errors: [Error!] | ||
| } | ||
|
|
||
| type DeletePositionPayload { | ||
| success: Boolean! | ||
| errors: [Error!] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| package department | ||
|
|
||
| import ( | ||
| "time" | ||
| ) | ||
|
|
||
| // DepartmentDTO represents a department data transfer object | ||
| type DepartmentDTO struct { | ||
| ID string `json:"id"` | ||
| Name string `json:"name"` | ||
| Description string `json:"description"` | ||
| ManagerID *string `json:"managerId,omitempty"` | ||
| CreatedAt time.Time `json:"createdAt"` | ||
| UpdatedAt time.Time `json:"updatedAt"` | ||
| } | ||
|
|
||
| // DepartmentConnectionDTO represents a paginated connection of departments | ||
| type DepartmentConnectionDTO struct { | ||
| Departments []*DepartmentDTO `json:"departments"` | ||
| NextCursor string `json:"nextCursor"` | ||
| } | ||
|
|
||
| // GetDepartmentRequest represents a request to get a department by ID | ||
| type GetDepartmentRequest struct { | ||
| ID string `json:"id"` | ||
| } | ||
|
|
||
| // GetDepartmentResponse represents a response for getting a department | ||
| type GetDepartmentResponse struct { | ||
| Department *DepartmentDTO `json:"department,omitempty"` | ||
| Errors []ErrorDTO `json:"errors,omitempty"` | ||
| } | ||
|
|
||
| // ListDepartmentsRequest represents a request to list departments | ||
| type ListDepartmentsRequest struct { | ||
| Limit int `json:"limit"` | ||
| Cursor string `json:"cursor,omitempty"` | ||
| } | ||
|
|
||
| // ListDepartmentsResponse represents a response for listing departments | ||
| type ListDepartmentsResponse struct { | ||
| Departments *DepartmentConnectionDTO `json:"departments,omitempty"` | ||
| Errors []ErrorDTO `json:"errors,omitempty"` | ||
| } | ||
|
|
||
| // ListDepartmentsByManagerRequest represents a request to list departments by manager | ||
| type ListDepartmentsByManagerRequest struct { | ||
| ManagerID string `json:"managerId"` | ||
| Limit int `json:"limit"` | ||
| Cursor string `json:"cursor,omitempty"` | ||
| } | ||
|
|
||
| // ListDepartmentsByManagerResponse represents a response for listing departments by manager | ||
| type ListDepartmentsByManagerResponse struct { | ||
| Departments *DepartmentConnectionDTO `json:"departments,omitempty"` | ||
| Errors []ErrorDTO `json:"errors,omitempty"` | ||
| } | ||
|
|
||
| // CreateDepartmentRequest represents a request to create a department | ||
| type CreateDepartmentRequest struct { | ||
| Name string `json:"name"` | ||
| Description string `json:"description"` | ||
| ManagerID *string `json:"managerId,omitempty"` | ||
| } | ||
|
|
||
| // CreateDepartmentResponse represents a response for creating a department | ||
| type CreateDepartmentResponse struct { | ||
| Department *DepartmentDTO `json:"department,omitempty"` | ||
| Errors []ErrorDTO `json:"errors,omitempty"` | ||
| } | ||
|
|
||
| // UpdateDepartmentRequest represents a request to update a department | ||
| type UpdateDepartmentRequest struct { | ||
| ID string `json:"id"` | ||
| Name *string `json:"name,omitempty"` | ||
| Description *string `json:"description,omitempty"` | ||
| ManagerID *string `json:"managerId,omitempty"` | ||
| } | ||
|
|
||
| // UpdateDepartmentResponse represents a response for updating a department | ||
| type UpdateDepartmentResponse struct { | ||
| Department *DepartmentDTO `json:"department,omitempty"` | ||
| Errors []ErrorDTO `json:"errors,omitempty"` | ||
| } | ||
|
|
||
| // DeleteDepartmentRequest represents a request to delete a department | ||
| type DeleteDepartmentRequest struct { | ||
| ID string `json:"id"` | ||
| } | ||
|
|
||
| // DeleteDepartmentResponse represents a response for deleting a department | ||
| type DeleteDepartmentResponse struct { | ||
| Success bool `json:"success"` | ||
| Errors []ErrorDTO `json:"errors,omitempty"` | ||
| } | ||
|
|
||
| // ErrorDTO represents an error data transfer object | ||
| type ErrorDTO struct { | ||
| Message string `json:"message"` | ||
| Field string `json:"field,omitempty"` | ||
| Code string `json:"code,omitempty"` | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion
Strongly type leave status as an enum.
Avoids invalid strings at runtime.
Follow-up: define enum LeaveStatus { PENDING APPROVED REJECTED CANCELED } in leave.graphqls.
🤖 Prompt for AI Agents