Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public ReservationCreateResponseDto create(Long storeId, CustomOAuth2User custom
.user(user)
.requestedAt(LocalDateTime.now())
.status(ReservationStatus.WAITING)
.partySize(requestDto.getPartySize())
.build();

Reservation saved = reservationRepository.save(reservation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ public class ManagerSignupRequestDto {

@NotBlank
@Pattern(regexp = "(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\\W)(?=\\S+$).{8,20}")
@Schema(description = "비밀번호", example = "1234568!@")
@Schema(description = "비밀번호", example = "1234568tt!@")
private String password;

@NotBlank
@Pattern(regexp = "^[a-zA-Z가-힣]{2,12}$")
@Schema(description = "닉네임", example = "가십이")
@Schema(description = "닉네임", example = "테스터")
private String nickname;

@NotBlank
@Schema(description = "로그인타입", example = "LOCAL")
private String socialType;
Comment on lines +34 to +36
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

socialType 필드 추가는 좋은 개선이지만, toEntity() 메서드와의 일관성 문제가 있습니다.

socialType 필드를 DTO에 추가한 것은 유연성을 높이는 좋은 개선사항입니다. 하지만 43번 줄의 toEntity() 메서드에서는 여전히 SocialType.LOCAL을 하드코딩하고 있어, 새로 추가된 필드 값이 실제로 사용되지 않고 있습니다.

일관성을 위해 다음과 같이 수정해주세요:

public User toEntity() {
    return User.builder()
        .email(email)
        .password(password)
        .nickname(nickname)
-       .socialType(SocialType.LOCAL)
+       .socialType(SocialType.valueOf(socialType))
        .role(Role.MANAGER)
        .build();
}

또는 socialType 필드를 실제로 사용하지 않을 예정이라면, 필드를 제거하거나 용도를 명확히 해주시면 좋겠습니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@NotBlank
@Schema(description = "로그인타입", example = "LOCAL")
private String socialType;
public User toEntity() {
return User.builder()
.email(email)
.password(password)
.nickname(nickname)
.socialType(SocialType.valueOf(socialType))
.role(Role.MANAGER)
.build();
}
🤖 Prompt for AI Agents
In src/main/java/com/example/gtable/user/dto/ManagerSignupRequestDto.java around
lines 34 to 36, the new socialType field is added but the toEntity() method at
line 43 still hardcodes SocialType.LOCAL, causing inconsistency. Update the
toEntity() method to use the socialType field's value instead of the hardcoded
constant, ensuring the DTO field is properly utilized. If socialType is not
intended for use, remove the field or clarify its purpose.


public User toEntity() {
return User.builder()
.email(email)
Expand Down
Loading