File tree Expand file tree Collapse file tree
src/main/java/inu/codin/codinticketingapi/domain/ticketing/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package inu .codin .codinticketingapi .domain .ticketing .service ;
22
33import inu .codin .codinticketingapi .domain .admin .entity .Event ;
4+ import inu .codin .codinticketingapi .domain .admin .entity .EventStatus ;
45import inu .codin .codinticketingapi .domain .ticketing .dto .event .ParticipationCreatedEvent ;
56import inu .codin .codinticketingapi .domain .ticketing .dto .response .ParticipationResponse ;
67import inu .codin .codinticketingapi .domain .ticketing .entity .Participation ;
7- import inu .codin .codinticketingapi .domain .ticketing .entity .ParticipationStatus ;
88import inu .codin .codinticketingapi .domain .ticketing .entity .Stock ;
99import inu .codin .codinticketingapi .domain .ticketing .exception .TicketingErrorCode ;
1010import inu .codin .codinticketingapi .domain .ticketing .exception .TicketingException ;
@@ -58,6 +58,11 @@ public ParticipationResponse saveParticipation(Long eventId) {
5858 // 이미 참여한 경우 기존 참여 내용 반환
5959 return ParticipationResponse .of (existingParticipation .get ());
6060 }
61+
62+ // 이벤트 상태 검증
63+ if (!event .getEventStatus ().equals (EventStatus .ACTIVE )) {
64+ throw new TicketingException (TicketingErrorCode .EVENT_NOT_ACTIVE );
65+ }
6166 // 재고 줄임
6267 Stock stock = ticketingService .decrement (eventId );
6368
You can’t perform that action at this time.
0 commit comments