-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into docs/api-docs
- Loading branch information
Showing
74 changed files
with
1,672 additions
and
268 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
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
46 changes: 46 additions & 0 deletions
46
src/main/java/com/prgrms/nabmart/domain/delivery/controller/FindDeliveryDetailResponse.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,46 @@ | ||
package com.prgrms.nabmart.domain.delivery.controller; | ||
|
||
import com.prgrms.nabmart.domain.delivery.Delivery; | ||
import com.prgrms.nabmart.domain.delivery.DeliveryStatus; | ||
import com.prgrms.nabmart.domain.order.OrderItem; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public record FindDeliveryDetailResponse( | ||
Long deliveryId, | ||
DeliveryStatus deliveryStatus, | ||
LocalDateTime arrivedAt, | ||
String address, | ||
String orderName, | ||
int orderPrice, | ||
String riderRequest, | ||
int deliveryFee, | ||
List<OrderItemResponse> items) { | ||
|
||
|
||
public static FindDeliveryDetailResponse from(final Delivery delivery) { | ||
List<OrderItemResponse> items = delivery.getOrder().getOrderItems().stream() | ||
.map(OrderItemResponse::from) | ||
.toList(); | ||
return new FindDeliveryDetailResponse( | ||
delivery.getDeliveryId(), | ||
delivery.getDeliveryStatus(), | ||
delivery.getArrivedAt(), | ||
delivery.getAddress(), | ||
delivery.getOrder().getName(), | ||
delivery.getOrderPrice(), | ||
delivery.getRiderRequest(), | ||
delivery.getDeliveryFee(), | ||
items); | ||
} | ||
|
||
public record OrderItemResponse(String name, int quantity, int price) { | ||
|
||
public static OrderItemResponse from(final OrderItem orderItem) { | ||
return new OrderItemResponse( | ||
orderItem.getItem().getName(), | ||
orderItem.getQuantity(), | ||
orderItem.getItem().getPrice()); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...n/java/com/prgrms/nabmart/domain/delivery/controller/request/RegisterDeliveryRequest.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,11 @@ | ||
package com.prgrms.nabmart.domain.delivery.controller.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
|
||
public record RegisterDeliveryRequest( | ||
@Positive(message = "배달 예상 소요 시간은 양수여야 합니다.") | ||
@NotNull(message = "배달 예상 소요 시간은 필수입니다.") | ||
Integer estimateMinutes) { | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...java/com/prgrms/nabmart/domain/delivery/exception/AlreadyRegisteredDeliveryException.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,8 @@ | ||
package com.prgrms.nabmart.domain.delivery.exception; | ||
|
||
public class AlreadyRegisteredDeliveryException extends DeliveryException { | ||
|
||
public AlreadyRegisteredDeliveryException(final String message) { | ||
super(message); | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...n/java/com/prgrms/nabmart/domain/delivery/service/request/FindDeliveryByOrderCommand.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,8 @@ | ||
package com.prgrms.nabmart.domain.delivery.service.request; | ||
|
||
public record FindDeliveryByOrderCommand(Long userId, Long orderId) { | ||
|
||
public static FindDeliveryByOrderCommand of(final Long userId,final Long orderId) { | ||
return new FindDeliveryByOrderCommand(userId, orderId); | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
src/main/java/com/prgrms/nabmart/domain/delivery/service/request/FindDeliveryCommand.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.