Skip to content

feat(api): add paginated + sortable + filterable list endpoints for e… - #16

Open
Chesblaw wants to merge 1 commit into
hoangsonww:masterfrom
Chesblaw:feat/#12_api-pagination-sorting-filtering
Open

feat(api): add paginated + sortable + filterable list endpoints for e…#16
Chesblaw wants to merge 1 commit into
hoangsonww:masterfrom
Chesblaw:feat/#12_api-pagination-sorting-filtering

Conversation

@Chesblaw

Copy link
Copy Markdown

…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.

@vercel

vercel Bot commented Sep 23, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
employee-management-fullstack-app Ignored Ignored Sep 23, 2025 7:57am

@netlify

netlify Bot commented Sep 23, 2025

Copy link
Copy Markdown

Deploy Preview for employee-management-fullstack-system canceled.

Name Link
🔨 Latest commit 1077d4d
🔍 Latest deploy log https://app.netlify.com/projects/employee-management-fullstack-system/deploys/68d252d358c26400086e8900

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JpaSpecificationExecutor for 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.

@hoangsonww hoangsonww added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers java Pull requests that update Java code labels Sep 23, 2025
@hoangsonww hoangsonww added this to the v2.x.x - Stable Release milestone Sep 23, 2025
@hoangsonww
hoangsonww requested a review from Copilot September 25, 2025 04:34

Copilot AI left a comment

Copy link
Copy Markdown

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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers java Pull requests that update Java code

Projects

Development

Successfully merging this pull request may close these issues.

Feature: Add first-class Pagination, Sorting, and Filtering for Employees & Departments

4 participants