Skip to content

Commit

Permalink
Api-v0.1.5-2
Browse files Browse the repository at this point in the history
Api-v0.1.5-2
  • Loading branch information
ImNM authored Feb 16, 2023
2 parents 07282a8 + fc3a372 commit 6dc4fc1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public class Event extends BaseTimeEntity {
@Enumerated(EnumType.STRING)
private EventStatus status = PREPARING;

private Boolean isUpdated = false;

public LocalDateTime getStartAt() {
if (this.eventBasic == null) {
return null;
Expand Down Expand Up @@ -72,10 +70,7 @@ public Boolean isPreparing() {
}

public void setEventBasic(EventBasic eventBasic) {
if (isUpdated) {
throw CannotModifyEventBasicException.EXCEPTION;
}
this.isUpdated = true;
this.validateOpenStatus();
this.eventBasic = eventBasic;
}

Expand All @@ -85,7 +80,7 @@ public void setEventDetail(EventDetail eventDetail) {
}

public void setEventPlace(EventPlace eventPlace) {
// 정보 한 번 등록시 변경 불가
this.validateOpenStatus();
this.eventPlace = eventPlace;
}

Expand All @@ -96,6 +91,11 @@ public Event(Long hostId, String name, LocalDateTime startAt, Long runTime) {
Events.raise(EventCreationEvent.of(hostId, name));
}

public void validateOpenStatus() {
if (status == OPEN) throw CannotModifyOpenEventException.EXCEPTION;
// todo : 오픈 전과 후 검증 로직 이름 변경
}

public void validateStatusOpen() {
if (status != OPEN) {
throw EventNotOpenException.EXCEPTION;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package band.gosrock.domain.domains.event.exception;


import band.gosrock.common.exception.DuDoongCodeException;

public class CannotModifyOpenEventException extends DuDoongCodeException {

public static final DuDoongCodeException EXCEPTION = new CannotModifyOpenEventException();

private CannotModifyOpenEventException() {
super(EventErrorCode.CANNOT_MODIFY_OPEN_EVENT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum EventErrorCode implements BaseErrorCode {
HOST_NOT_AUTH_EVENT(BAD_REQUEST, "Event_400_1", "Host Not Auth Event."),
EVENT_CANNOT_END_BEFORE_START(BAD_REQUEST, "Event_400_2", "시작 시각은 종료 시각보다 빨라야 합니다."),
EVENT_URL_NAME_ALREADY_EXIST(BAD_REQUEST, "Event_400_3", "중복된 URL 표시 이름입니다."),
CANNOT_MODIFY_EVENT_BASIC(BAD_REQUEST, "Event_400_4", "이벤트 기본 정보는 수정할 수 없습니다."),
CANNOT_MODIFY_OPEN_EVENT(BAD_REQUEST, "Event_400_4", "오픈된 이벤트 정보는 수정할 수 없습니다."),
EVENT_NOT_OPEN(BAD_REQUEST, "Event_400_5", "아직 오픈되지 않은 이벤트에는 접근할 수 없습니다."),
EVENT_TICKETING_TIME_IS_PASSED(BAD_REQUEST, "Event_400_6", "이벤트 시작시간이 지나 티켓팅을 할 수 없습니다."),
CANNOT_OPEN_EVENT(BAD_REQUEST, "Event_400_7", "이벤트 오픈 조건을 충족하지 않았습니다."),
Expand Down

0 comments on commit 6dc4fc1

Please sign in to comment.