Skip to content

Commit

Permalink
Merge pull request #120 from IT-Cotato/develop
Browse files Browse the repository at this point in the history
[Release] V2 2024.08.21.02
  • Loading branch information
Youthhing authored Aug 21, 2024
2 parents e62f398 + 2283dd1 commit 1e4fe42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.cotato.csquiz.api.session.dto;

import static org.cotato.csquiz.domain.attendance.enums.DeadLine.DEFAULT_ATTENDANCE_DEADLINE;
import static org.cotato.csquiz.domain.attendance.enums.DeadLine.DEFAULT_LATE_DEADLINE;

import java.time.LocalDate;
import java.util.Objects;
import org.cotato.csquiz.api.attendance.dto.AttendanceDeadLineDto;
import org.cotato.csquiz.domain.attendance.embedded.Location;
import org.cotato.csquiz.domain.generation.enums.CSEducation;
Expand Down Expand Up @@ -28,4 +32,10 @@ public record UpdateSessionRequest(
@NotNull
DevTalk devTalk
) {
public UpdateSessionRequest {
if (Objects.isNull(attendTime)) {
attendTime = new AttendanceDeadLineDto(DEFAULT_ATTENDANCE_DEADLINE.getTime(),
DEFAULT_LATE_DEADLINE.getTime());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public void updateSessionDate(Session session, LocalDate newDate, AttendanceDead
Attendance findAttendance = attendanceRepository.findBySessionId(session.getId())
.orElseThrow(() -> new EntityNotFoundException("해당 세션의 출석이 존재하지 않습니다"));


// 날짜가 바뀌지 않았고, 출결 시간이 모두 동일한 경우
if (newDate.equals(session.getSessionDate()) &&
findAttendance.getAttendanceDeadLine().toLocalTime().equals(newDeadline.attendanceDeadLine()) &&
Expand All @@ -140,7 +141,7 @@ public void updateSessionDate(Session session, LocalDate newDate, AttendanceDead
session.updateSessionDate(newDate);

LocalDateTime newAttendanceDeadline = LocalDateTime.of(newDate, newDeadline.attendanceDeadLine());
LocalDateTime newLateDeadline = LocalDateTime.of(newDate, newDeadline.attendanceDeadLine());
LocalDateTime newLateDeadline = LocalDateTime.of(newDate, newDeadline.lateDeadLine());
findAttendance.updateDeadLine(newAttendanceDeadline, newLateDeadline);

attendanceRecordService.updateAttendanceStatus(findAttendance);
Expand Down

0 comments on commit 1e4fe42

Please sign in to comment.