Skip to content

Commit

Permalink
fix: 빌더에서 전달된 값 그대로 할당하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Feb 9, 2025
1 parent 194a2c7 commit 0486ffe
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class StudyHistory extends BaseEntity {
@Column(name = "study_history_id")
private Long id;

private String repositoryLink;

@Comment("수료 상태")
@Enumerated(EnumType.STRING)
private StudyHistoryStatus studyHistoryStatus;

private String repositoryLink;
private StudyHistoryStatus status;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
Expand All @@ -50,14 +50,14 @@ public class StudyHistory extends BaseEntity {
private Study study;

@Builder(access = AccessLevel.PRIVATE)
private StudyHistory(Member student, Study study) {
this.studyHistoryStatus = NONE;
private StudyHistory(StudyHistoryStatus status, Member student, Study study) {
this.status = status;
this.student = student;
this.study = study;
}

public static StudyHistory create(Member student, Study study) {
return StudyHistory.builder().student(student).study(study).build();
return StudyHistory.builder().status(NONE).student(student).study(study).build();
}

@PreRemove
Expand All @@ -76,14 +76,14 @@ public void updateRepositoryLink(String repositoryLink) {
* 스터디 수료
*/
public void complete() {
studyHistoryStatus = COMPLETED;
status = COMPLETED;
}

/**
* 스터디 수료 철회
*/
public void withdrawCompletion() {
studyHistoryStatus = NONE;
status = NONE;
registerEvent(new StudyHistoryCompletionWithdrawnEvent(this.id));
}

Expand All @@ -93,6 +93,6 @@ public boolean isWithinApplicationAndCourse(LocalDateTime now) {
}

public boolean isCompleted() {
return studyHistoryStatus == COMPLETED;
return status == COMPLETED;
}
}

0 comments on commit 0486ffe

Please sign in to comment.