Skip to content

Commit

Permalink
[BE] FIX: Presentation
Browse files Browse the repository at this point in the history
form 취소 시 기존 폼 변경 후 해당 날짜에 더미 폼 생성
  • Loading branch information
chyo1 committed Oct 22, 2024
1 parent bb8caf1 commit 86857c7
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,19 @@ public void updatePresentationByFormId(Long formId, PresentationUpdateDto dto) {
Presentation presentationToUpdate =
presentationRepository.findById(formId)
.orElseThrow(ExceptionStatus.INVALID_FORM_ID::asServiceException);
//날짜 변경시에만 유효성 검증

// 날짜 변경시에만 유효성 검증
if (!presentationToUpdate.getDateTime().isEqual(dto.getDateTime())) {
presentationPolicyService.verifyReservationDate(dto.getDateTime());
}

// 발표 취소 시 해당 날짜에 더미 폼 생성
if (dto.getStatus() == PresentationStatus.CANCEL) {
Presentation presentation = Presentation.of(Category.DUMMY, dto.getDateTime(),
PresentationTime.HALF, "dummy", "dummy", "dummy");
presentationRepository.save(presentation);
}

presentationToUpdate.adminUpdate(dto.getStatus(), dto.getDateTime(), dto.getLocation());
}

Expand Down

0 comments on commit 86857c7

Please sign in to comment.