Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates boilerplate by switching many classes from individual Lombok @Getter/@Setter to @Data, removes outdated DTOs and lifecycle callbacks, and introduces a new PersonBasicDTO with corresponding mapper and service/controller updates.
- Replaced
@Getter/@Setterwith@Datain entity and DTO classes - Removed manual
@PrePersist/@PreUpdatemethods in favor of Hibernate timestamp annotations - Added
PersonBasicDTOand updated service, controller, and mapper to return it instead of the projection - Deleted unused create-request DTOs
Reviewed Changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
UserEntity.java |
Replaced Lombok getters/setters with @Data |
RecordDetailCreateRequestDTO.java |
Switched to @Data, but left unused imports |
PeopleDtoMapper.java |
Added toPersonBasicDto mapping method |
PeopleServiceImpl.java |
Updated findBasicById to map projection to PersonBasicDTO |
PeopleController.java |
Changed endpoint to return PersonBasicDTO |
| Other entity/DTO files | Similar Lombok annotation replacements and timestamp updates |
Comments suppressed due to low confidence (2)
src/main/java/com/historialplus/historialplus/internal/people/service/PeopleServiceImpl.java:128
- Consider adding a unit test for
findBasicByIdto verify the projection-to-DTO mapping, especially date and enum transformations intoPersonBasicDto.
return repository.findBasicById(id).map(PeopleDtoMapper::toPersonBasicDto);
src/main/java/com/historialplus/historialplus/internal/user/entites/UserEntity.java:31
- [nitpick] Consider avoiding
@Dataon JPA entities; it generatesequals/hashCodeincluding all fields, which can cause issues with lazy associations—prefer@Getter/@Setterplus a tailored@EqualsAndHashCode(onlyExplicitlyIncluded = true).
@Data
| import lombok.Getter; | ||
| import lombok.Setter; |
There was a problem hiding this comment.
Remove the unused lombok.Getter and lombok.Setter imports now that @Data is used to avoid stale imports.
| import lombok.Getter; | |
| import lombok.Setter; |
There was a problem hiding this comment.
Tener en cuenta que el FileDTO usar el getter y setter
| .name(input.getName()) | ||
| .paternalSurname(input.getPaternalSurname()) | ||
| .maternalSurname(input.getMaternalSurname()) | ||
| .birthdate(input.getBirthdate()) |
There was a problem hiding this comment.
The DTO birthdate is a String but input.getBirthdate() likely returns a Date or LocalDate—add explicit formatting or conversion to avoid a type mismatch at runtime.
| import lombok.Getter; | ||
| import lombok.Setter; |
There was a problem hiding this comment.
Tener en cuenta que el FileDTO usar el getter y setter
|



No description provided.