feat(api): add paginated + sortable + filterable list endpoints for e… - #16
Open
Chesblaw wants to merge 1 commit into
Open
feat(api): add paginated + sortable + filterable list endpoints for e…#16Chesblaw wants to merge 1 commit into
Chesblaw wants to merge 1 commit into
Conversation
…mployees and departments
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✅ Deploy Preview for employee-management-fullstack-system canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This pull request implements paginated, sortable, and filterable list endpoints for employees and departments, enhancing the API with consistent pagination contracts and query performance improvements through database indexes.
- Extends repository interfaces with
JpaSpecificationExecutorfor advanced querying capabilities - Adds typed DTOs for list responses (
EmployeeListDto,DepartmentListDto) with pagination metadata - Implements comprehensive validation for sort parameters and input constraints
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
13 tasks
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 36 out of 65 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
hoangsonww
approved these changes
Dec 7, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…mployees and departments
Pull Request Template
Overview
Briefly describe the purpose of this pull request. What features or bug fixes are included?
Implements consistent pagination, sorting, and filtering for both Employees and Departments endpoints.
Adds typed pagination contract and validation.
Improves query performance with indexes.
Related Issue/Ticket
Link any related issue or ticket here.
new feature
Files Changed
List the files that have been added, deleted, or modified.
Repositories: extended JpaSpecificationExecutor
Specifications:
Employee → q search (firstName, lastName, email), filters (departmentId, age range)
Department → q search (name)
DTOs/Mapping:
EmployeeListDto(id, firstName, lastName, email, departmentName, age)
DepartmentListDto(id, name)
Validation:
Sort whitelist
Employees → id, firstName, lastName, email, age, department.id, department.name
Departments → id, name
Size clamped to max 100
Entities: added @Index annotations
Employees: firstName, lastName, email, department_id, age
Departments: name
Testing
Describe how you tested these changes.
Manual (Postman):
GET /api/employees?page=0&size=10&sort=id,asc
GET /api/employees?q=john&sort=lastName,desc
GET /api/employees?departmentId=3&minAge=20&maxAge=29&sort=firstName,asc
GET /api/employees?sort=hacker,asc → expect 400
GET /api/departments?page=1&size=25&sort=name,asc
GET /api/departments?q=eng&sort=id,desc
Screenshots (if applicable)
Include screenshots or GIFs if you've made UI changes.
Notes to Reviewers
Add any notes for reviewers, such as areas to focus on, decisions you made, etc.
Focus on repository filtering logic and validation rules.
Confirm pagination metadata format
Deployment Notes
Include any necessary steps for deployment, configuration changes, etc.