-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor : 이벤트 오픈 api 분리 #320
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엘쥐티엠!
final Event event = eventAdaptor.findById(eventId); | ||
final Boolean hasBasic = event.hasEventBasic() && event.hasEventPlace(); | ||
final Boolean hasDetail = event.hasEventDetail(); | ||
final Boolean hasTicketItem = ticketItemAdaptor.existsByEventId(event.getId()); | ||
if (hasBasic && hasDetail && hasTicketItem) { | ||
return EventResponse.of(eventService.openEvent(event)); | ||
} | ||
// 체크리스트를 달성하지 않으면 이벤트를 열 수 없음 | ||
throw CannotOpenEventException.EXCEPTION; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
도메인 레이어 까지 내리는게.. 좋아보입니다! 검증은요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
도메인 레이어 까지 내리는게.. 좋아보입니다! 검증은요!
티켓 아이템 걸려있어서 일부로 안내렸어요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
도메인 서비스에 내리시는건 어떨까요!
이럴때 쓰라구있는 서비스이니
@gengminy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
도메인 서비스에 내리시는건 어떨까요! 이럴때 쓰라구있는 서비스이니 @gengminy
티켓 아이템 서비스에다 검증 하라는 말인지요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eventService.openEvent 해당 메서드로 옮기시면 좋을듯합니다
추천드린책에도 도메인서비스에서 다른 도메인 참고해도 좋다는 내용나와요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eventService.openEvent 해당 메서드로 옮기시면 좋을듯합니다
추천드린책에도 도메인서비스에서 다른 도메인 참고해도 좋다는 내용나와요!
흠 확실히 이벤트 서비스에 내리는게 맞긴 한데 티켓 아이템 서비스 낀게 모양이 맘에 안드네요
throw CannotOpenEventException.EXCEPTION; | ||
eventService.validateEventBasicExistence(event); | ||
eventService.validateEventDetailExistence(event); | ||
ticketItemService.validateExistenceByEventId(eventId); | ||
|
||
return EventResponse.of(eventService.openEvent(event)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eventService.openEvent(event)
해당 메소드 내부에
eventService.validateEventBasicExistence(event);
eventService.validateEventDetailExistence(event);
ticketItemService.validateExistenceByEventId(eventId);
세 메소드가 들어가면 더더 좋을것 같아요!ㅎㅎ
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
개요
작업사항
변경로직