-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat : 이벤트 삭제 프로토타입 * feat : 오픈 상태이거나 발급 티켓 있으면 삭제 불가
- Loading branch information
Showing
16 changed files
with
120 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
DuDoong-Api/src/main/java/band/gosrock/api/event/service/DeleteEventUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package band.gosrock.api.event.service; | ||
|
||
import static band.gosrock.api.common.aop.hostRole.FindHostFrom.EVENT_ID; | ||
import static band.gosrock.api.common.aop.hostRole.HostQualification.MANAGER; | ||
|
||
import band.gosrock.api.common.aop.hostRole.HostRolesAllowed; | ||
import band.gosrock.api.event.model.dto.response.EventResponse; | ||
import band.gosrock.common.annotation.UseCase; | ||
import band.gosrock.domain.domains.event.adaptor.EventAdaptor; | ||
import band.gosrock.domain.domains.event.domain.Event; | ||
import band.gosrock.domain.domains.event.service.EventService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@UseCase | ||
@RequiredArgsConstructor | ||
public class DeleteEventUseCase { | ||
private final EventService eventService; | ||
private final EventAdaptor eventAdaptor; | ||
|
||
@Transactional | ||
@HostRolesAllowed(role = MANAGER, findHostFrom = EVENT_ID) | ||
public EventResponse execute(Long eventId) { | ||
final Event event = eventAdaptor.findById(eventId); | ||
return EventResponse.of(eventService.deleteEventSoft(event)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../main/java/band/gosrock/domain/domains/event/exception/AlreadyDeletedStatusException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 AlreadyDeletedStatusException extends DuDoongCodeException { | ||
|
||
public static final DuDoongCodeException EXCEPTION = new AlreadyDeletedStatusException(); | ||
|
||
private AlreadyDeletedStatusException() { | ||
super(EventErrorCode.ALREADY_DELETED_STATUS); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...java/band/gosrock/domain/domains/event/exception/CannotDeleteByIssuedTicketException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 CannotDeleteByIssuedTicketException extends DuDoongCodeException { | ||
|
||
public static final DuDoongCodeException EXCEPTION = new CannotDeleteByIssuedTicketException(); | ||
|
||
private CannotDeleteByIssuedTicketException() { | ||
super(EventErrorCode.CANNOT_DELETE_BY_ISSUED_TICKET); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...in/java/band/gosrock/domain/domains/event/exception/CannotDeleteByOpenEventException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 CannotDeleteByOpenEventException extends DuDoongCodeException { | ||
|
||
public static final DuDoongCodeException EXCEPTION = new CannotDeleteByOpenEventException(); | ||
|
||
private CannotDeleteByOpenEventException() { | ||
super(EventErrorCode.CANNOT_DELETE_BY_OPEN_EVENT); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters