Skip to content

Conversation

@luislh-dev
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 4, 2025 22:30
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 4, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors entity and DTO classes to replace Lombok’s @Data with explicit @Getter and @Setter, introduces builder patterns for response DTOs, and updates the RecordDetailDtoMapper to use the builder.

  • Replace @Data with @Getter/@Setter on JPA entities and request DTOs
  • Add @Builder to response DTOs and remove manual constructors
  • Update RecordDetailDtoMapper to instantiate the DTO via its builder

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/com/historialplus/historialplus/internal/user/entites/UserEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/user/dto/request/DoctorCreationDto.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/state/entities/StateEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/sextype/entities/SexTypeEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/role/entites/RoleEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/recorddetail/mapper/RecordDetailDtoMapper.java Switched to builder instantiation
src/main/java/com/historialplus/historialplus/internal/recorddetail/entites/RecordDetailEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/recorddetail/dto/response/RecordDetailResponseDto.java Added @Builder; removed manual constructor
src/main/java/com/historialplus/historialplus/internal/record/entites/RecordEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/people/entities/PeopleEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/patientallergy/entities/PatientAllergyEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/hospital/entities/HospitalEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/filetype/entities/FileTypeEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/file/entites/FileEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/documenttype/entities/DocumentTypeEntity.java Replaced @Data with @Getter/@Setter
src/main/java/com/historialplus/historialplus/internal/allergycatalog/entities/AllergyCatalogEntity.java Replaced @Data with @Getter/@Setter
Comments suppressed due to low confidence (2)

src/main/java/com/historialplus/historialplus/internal/recorddetail/mapper/RecordDetailDtoMapper.java:24

  • Consider adding or updating unit tests to cover this mapper method, verifying each field is correctly mapped from RecordDetailEntity to RecordDetailResponseDto.
    public static RecordDetailResponseDto toResponseDto(RecordDetailEntity detailEntity) {

src/main/java/com/historialplus/historialplus/internal/user/entites/UserEntity.java:32

  • [nitpick] Replacing @DaTa removes generated equals() and hashCode() methods. If entity equality or hash-based collections rely on these, consider adding explicit implementations or using @EqualsAndHashCode.
@Getter


@Getter
@Setter
@Builder
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

DTOs used for JSON serialization often require a no-args constructor. Consider adding @NoArgsConstructor to this class to ensure frameworks like Jackson can deserialize it.

Suggested change
@Builder
@Builder
@NoArgsConstructor

Copilot uses AI. Check for mistakes.
@luislh-dev luislh-dev merged commit b46f76d into master Jul 4, 2025
5 checks passed
@luislh-dev luislh-dev deleted the refactor/mappers-and-dtos branch July 4, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants