Skip to content

Commit

Permalink
hotfix: 마감 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks committed Sep 12, 2024
1 parent 30f5d23 commit 1a7ec97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public void create(AnswerListCreateRequest request, Long spaceId, Long retrospec

Answers answers = new Answers(answerRepository.findAllByRetrospectId(retrospectId));

// 마지막 답변일 경우 -> ai 분석 실행
if (answers.getWriteCount(retrospectId) == team.getTeamMemberCount()){
// 마지막 답변이고, 마감일이 지정되지 않은 경우 -> ai 분석 실행
if (answers.getWriteCount(retrospectId) == team.getTeamMemberCount() && !retrospect.hasDeadLine()){
retrospect.updateRetrospectStatus(RetrospectStatus.DONE, time.now());
retrospect.updateAnalysisStatus(AnalysisStatus.PROCEEDING);
retrospectRepository.saveAndFlush(retrospect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void updateRetrospect(String title, String introduction, LocalDateTime de
public void updateRetrospectStatus(RetrospectStatus retrospectStatus, LocalDateTime now) {
isProceedingRetrospect();

if(this.deadline != null && now.isBefore(this.deadline)){
if (this.deadline != null && now.isBefore(this.deadline)) {
return;
}

Expand All @@ -100,4 +100,12 @@ public void updateRetrospectStatus(RetrospectStatus retrospectStatus, LocalDateT
public void updateAnalysisStatus(AnalysisStatus analysisStatus) {
this.analysisStatus = analysisStatus;
}

public boolean hasDeadLine() {
if (this.deadline == null) {
return false;
}

return true;
}
}

0 comments on commit 1a7ec97

Please sign in to comment.