Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#99 #103

Merged
merged 9 commits into from
Sep 3, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import jakarta.validation.constraints.NotNull;

public record JoinStudentReq(@NotEmpty String id, @NotEmpty String pw, @NotEmpty String name, @NotEmpty @Email String email,
@NotEmpty String phone, @NotNull int grade, @NotNull int room, @NotNull int number) {
@NotEmpty String phone, @NotNull String parentPhone, @NotNull int grade, @NotNull int room, @NotNull int number) {
public Student mapToStudent(Member member) {
return Student.builder()
.member(member)
Expand All @@ -27,6 +27,7 @@ public Member mapToMember(String encodedPw) {
.name(name)
.role(MemberRole.STUDENT)
.phone(phone)
.parentPhone(parentPhone)
.status(ActiveStatus.DEACTIVATE)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ public ResponseData<Boolean> checkBroadcastClubMember(@PathVariable String id) {
return queryUseCase.checkBroadcastClubMember(id);
}


suw0n marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public class Member extends BaseEntity {
@NotNull
private String phone;

private String parentPhone;
suw0n marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

부모님 번호는 공통 정보가 아니라 학생의 정보이므로 굳이 member 에 추가하기 보다는 student에 추가하는게 맞는 것 같습니다

Copy link
Member

Choose a reason for hiding this comment

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

@NotNull 도 추가해주세요

Copy link
Member Author

Choose a reason for hiding this comment

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


@Builder
public Member(String id, String pw, String name, String email, MemberRole role, ActiveStatus status, String profileImage, String phone) {
public Member(String id, String pw, String name, String email, MemberRole role, ActiveStatus status, String profileImage, String phone, String parentPhone) {
this.id = id;
this.pw = pw;
this.email = email;
Expand All @@ -54,6 +56,7 @@ public Member(String id, String pw, String name, String email, MemberRole role,
this.status = status;
this.profileImage = profileImage;
this.phone = phone;
this.parentPhone = parentPhone;
}

public void updatePw(String pw) {
Expand Down