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

[BE] 방 생성 검증 로직 부활(#753) #762

Merged
merged 6 commits into from
Nov 15, 2024
Merged

[BE] 방 생성 검증 로직 부활(#753) #762

merged 6 commits into from
Nov 15, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 15, 2024

📌 관련 이슈

✨ PR 세부 내용

방 생성 시 기간 검증 로직을 RoomDeadline 클래스를 통해 관리하도록 추가했습니다.

RoomDeadline 클래스는 @Embeddable로 정의되었고, recruitmentDeadline과 reviewDeadline 필드를 포함하고 있습니다.

이와 관련하여 발생한 문제는 RoomRepository에서 recruitmentDeadline과 reviewDeadline을 인식하지 못한 점입니다.
@Embedded 타입의 필드는 리포지토리에서 접근 시 @Embeddable클래스명_변수명 형식을 사용해야 한다는 점을 확인했습니다.

List<Room> findAllByIdInOrderByRoomDeadline_ReviewDeadlineAsc(List<Long> ids);

@github-actions github-actions bot added BE 백엔드 개발 관련 작업 기능 기능 구현 작업 labels Nov 15, 2024
Copy link
Contributor Author

github-actions bot commented Nov 15, 2024

Test Results

 65 files   65 suites   7s ⏱️
200 tests 183 ✅ 17 💤 0 ❌
216 runs  199 ✅ 17 💤 0 ❌

Results for commit edec3b4.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@ashsty ashsty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 뽀로로~~

크게 바뀐 부분은 없는 것 같아 질문 한 가지만 남겨뒀어용!
정책 관련 부분일 것 같아서 체크하고 넘어가면 좋겠네용

고생하셨어요!

Comment on lines 32 to 36
if (recruitmentDeadline.isBefore(currentDateTime)) {
throw new CoreaException(ExceptionType.INVALID_RECRUITMENT_DEADLINE);
}

if (reviewDeadline.isBefore(recruitmentDeadline)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문: 이거 둘 다 isBefore로 처리해도 괜찮은가요?

"현재 시간과 동일하게 / 모집 마감 시간과 동일하게" 방 생성하는 경우는 막지 않아도 괜찮은 건지 궁금합니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

막아야겠네요! 감사합니다~ 수정할게요! 👍

Copy link
Contributor

@hjk0761 hjk0761 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빠르게 구현하셨네요! 고생하셨어요!!
궁금한 점 달아두었습니다~

private LocalDateTime recruitmentDeadline;

private LocalDateTime reviewDeadline;
@Embedded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 프로덕션, 데브의 스키마가 바뀔 필요가 없겠네용 👍

@@ -12,9 +12,9 @@

public interface RoomRepository extends JpaRepository<Room, Long>, JpaSpecificationExecutor<Room> {

Page<Room> findAllByStatusOrderByRecruitmentDeadline(RoomStatus status, Pageable pageable);
Page<Room> findAllByStatusOrderByRoomDeadline_RecruitmentDeadline(RoomStatus status, Pageable pageable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 본문이 이걸 말한거였군요

Comment on lines 32 to 36
if (recruitmentDeadline.isBefore(currentDateTime)) {
throw new CoreaException(ExceptionType.INVALID_RECRUITMENT_DEADLINE);
}

if (reviewDeadline.isBefore(recruitmentDeadline)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모집 마감은 지금 이후로, 리뷰 마감은 모집 마감 이후로 설정되어 있는데,
프론트에서도 백과 같은 범주로 검사하는지 궁금해요!

이전엔 1시간, 하루의 텀을 두었던 거로 기억하는데, 이는 살리지 않는거죠?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프론트에서도 백과 같은 범주로 검사하는지 궁금해요!

넵 프론트와 동일하게 검증하고 있습니다.

이전엔 1시간, 하루의 텀을 두었던 거로 기억하는데, 이는 살리지 않는거죠?

넵 단순히 모집 마감은 현재 시간 이후로, 리뷰 마감은 모집 마감 이후로 검증하도록 통일했어요~
(텐텐 의견 99.9999% 반영)

@jcoding-play jcoding-play merged commit ef4c468 into develop Nov 15, 2024
6 checks passed
@jcoding-play jcoding-play deleted the feat/#753 branch November 15, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 개발 관련 작업 기능 기능 구현 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 방 생성 검증 로직 부활 [BE] Room 생성 시 validation 로직 부활
3 participants