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

Api-v0.1.5-2 #369

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
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 @@ -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