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

feat: 과제 마감날짜 유효성 검사 로직 수정 #759

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void validateCancelStudyAssignment(Member member, StudyDetail studyDetail
public void validatePublishStudyAssignment(
Member member, StudyDetail studyDetail, AssignmentCreateUpdateRequest request) {
validateStudyMentorAuthorization(member, studyDetail);
validateDeadLine(request.deadLine());
validateDeadLine(request.deadLine(), studyDetail.getPeriod().getStartDate());
}

// 해당 스터디의 멘토가 아니라면 스터디에 대한 권한이 없다.
Expand All @@ -29,8 +29,8 @@ private void validateStudyMentorAuthorization(Member member, StudyDetail studyDe
}
}

private void validateDeadLine(LocalDateTime deadline) {
if (deadline.isBefore(LocalDateTime.now())) {
private void validateDeadLine(LocalDateTime deadline, LocalDateTime studyStartDate) {
if (deadline.isBefore(LocalDateTime.now()) || deadline.isBefore(studyStartDate)) {
throw new CustomException(ASSIGNMENT_DEADLINE_INVALID);
}
}
Expand Down