Skip to content

Commit 9ca913c

Browse files
committed
[hotfix] 월별 조회시 날짜별 진행도 결정 로직 수정
1 parent 9cf18a6 commit 9ca913c

File tree

1 file changed

+11
-4
lines changed
  • src/main/java/com/moplus/moplus_server/client/submit/dto/response

1 file changed

+11
-4
lines changed

src/main/java/com/moplus/moplus_server/client/submit/dto/response/DayProgress.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ public static DayProgress determineDayProgress(List<ProblemSubmitStatus> problem
1111
if (problemStatuses.isEmpty()) {
1212
return INCOMPLETE;
1313
}
14-
else if (problemStatuses.contains(ProblemSubmitStatus.IN_PROGRESS)) {
15-
return IN_PROGRESS;
16-
}
17-
else{
14+
boolean allNotStarted = problemStatuses.stream()
15+
.allMatch(status -> status == ProblemSubmitStatus.NOT_STARTED);
16+
17+
boolean allFinished = problemStatuses.stream()
18+
.allMatch(status -> status == ProblemSubmitStatus.CORRECT || status == ProblemSubmitStatus.INCORRECT);
19+
20+
if (allNotStarted) {
21+
return INCOMPLETE;
22+
} else if (allFinished) {
1823
return COMPLETE;
24+
} else {
25+
return IN_PROGRESS;
1926
}
2027
}
2128
}

0 commit comments

Comments
 (0)