Employee management with DateRange filters and APIs#7
Conversation
Teammate reformatted SQL files which caused Flyway checksum mismatch on startup. Restored original file content from git history to match what was applied to the DB.
Encapsulates from/to LocalDate pair. Used in search requests across employee, department, and future domains to avoid verbose fromX/toX field explosion.
… DateRange Replace standalone LocalDateTime createdAt/updatedAt fields with DateRange records. Update DepartmentSpecification to use atStartOfDay/atTime(23,59,59) for proper LocalDate to LocalDateTime conversion in between predicates.
…oyeeSpecification - EmployeeResponse: record with all account fields + employee fields + nested DepartmentResponse - SearchEmployeeRequest: extends PaginatedRequest with DateRange filters for dob/hireDate/createdAt/updatedAt - EmployeeSpecification: dynamic filtering with always-joined account and conditional department join, OR logic for name search across fullName and username - EmployeeInfoRepository: add JpaSpecificationExecutor for Specification support
- GetEmployeeService: overrides execute() with @transactional(readOnly=true) to keep Hibernate session open during lazy relationship mapping (account, department, role) - EmployeeController: add GET /employees endpoint with @ModelAttribute SearchEmployeeRequest
…tion bypass @transactional on doProcess() is never intercepted by Spring AOP proxy because doProcess() is called internally via this.doProcess() inside BaseService.execute(). Transaction never starts. Fix: override execute() in each service and annotate that instead. - CreateEmployeeService: @transactional on execute() - CreatePatientService: @transactional on execute() (was incorrectly readOnly=true) - application.yml: remove repair-on-migrate (not a valid Flyway property)
🔍 PR ReviewSummaryThis PR introduces enhancements including date range filtering for employee management in the backend API and API documentation annotations using Swagger. It touches multiple files to update request/response models, introduce validation rules, and add API documentation. Issues Found[File: SignInRequest.java, ~line 6]
[File: AccountResponse.java, ~line 5]
[File: AuthResponse.java, ~line 18]
[File: PaginatedRequest.java, ~line 18]
[File: PaginatedRequest.java, ~line 19]
[File: BaseRequest.java, ~line 14]
[General Observation]
What's Done Well
Verdict🔴 Needs changes 🤖 Automated review by GitHub Models |
|
Lead said gud to go! |
No description provided.