-
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.
feature : 승인 대기중인 주문 관리자 취소 기능 추가 (#559)
* feat : order refuse * feat : refuse 메서드 생성 * style : spotlesS * fix : 주문 거절 기능 컨트롤러에서 사용
- Loading branch information
Showing
7 changed files
with
85 additions
and
2 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
26 changes: 26 additions & 0 deletions
26
DuDoong-Api/src/main/java/band/gosrock/api/order/service/RefuseOrderUseCase.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,26 @@ | ||
package band.gosrock.api.order.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.order.model.dto.response.OrderResponse; | ||
import band.gosrock.api.order.model.mapper.OrderMapper; | ||
import band.gosrock.common.annotation.UseCase; | ||
import band.gosrock.domain.domains.order.service.WithdrawOrderService; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@UseCase | ||
@RequiredArgsConstructor | ||
public class RefuseOrderUseCase { | ||
|
||
private final WithdrawOrderService withdrawOrderService; | ||
|
||
private final OrderMapper orderMapper; | ||
|
||
@HostRolesAllowed(role = MANAGER, findHostFrom = EVENT_ID, applyTransaction = false) | ||
public OrderResponse execute(Long eventId, String orderUuid) { | ||
withdrawOrderService.refuseOrder(orderUuid); | ||
return orderMapper.toOrderResponse(orderUuid); | ||
} | ||
} |
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
...src/main/java/band/gosrock/domain/domains/order/exception/CanNotRefuseOrderException.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.order.exception; | ||
|
||
|
||
import band.gosrock.common.exception.DuDoongCodeException; | ||
|
||
public class CanNotRefuseOrderException extends DuDoongCodeException { | ||
|
||
public static final DuDoongCodeException EXCEPTION = new CanNotRefuseOrderException(); | ||
|
||
private CanNotRefuseOrderException() { | ||
super(OrderErrorCode.ORDER_CANNOT_REFUSE); | ||
} | ||
} |
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