File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/main/java/com/somemore/recruitboard/domain Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11package com .somemore .recruitboard .domain ;
22
3- import static com .somemore .recruitboard .domain .RecruitStatus .CLOSED ;
43import static com .somemore .recruitboard .domain .RecruitStatus .RECRUITING ;
54import static jakarta .persistence .EnumType .STRING ;
65import static jakarta .persistence .GenerationType .IDENTITY ;
@@ -104,9 +103,10 @@ private void updateRecruitmentInfo(RecruitBoardUpdateRequestDto dto) {
104103 }
105104
106105 private void validateStatusChange (RecruitStatus newStatus ) {
107- if (newStatus != RECRUITING && newStatus != CLOSED ) {
108- throw new IllegalArgumentException ( "상태는 '모집중' 또는 '마감'으로만 변경할 수 있습니다." ) ;
106+ if (newStatus . isChangeable () ) {
107+ return ;
109108 }
109+ throw new IllegalArgumentException ("상태는 '모집중' 또는 '마감'으로만 변경할 수 있습니다." );
110110 }
111111
112112 private void validateChangeDeadline (LocalDateTime currentDateTime ) {
Original file line number Diff line number Diff line change 66@ Getter
77@ RequiredArgsConstructor
88public enum RecruitStatus {
9- RECRUITING ("모집중" ),
10- CLOSED ("마감" ),
11- COMPLETED ("종료" ),
9+ RECRUITING ("모집중" , true ),
10+ CLOSED ("마감" , true ),
11+ COMPLETED ("종료" , false ),
1212
1313 ;
1414 private final String text ;
15-
15+ private final boolean changeable ;
1616}
You can’t perform that action at this time.
0 commit comments