Skip to content

Commit

Permalink
feat: Order 엔티티에 상태 변경용 정적 팩토리 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
choi5798 committed Sep 15, 2023
1 parent be2b114 commit 7294ac0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/com/ray/pominowner/orders/domain/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static Order of(Order order, OrderStatus status, Integer receiptNumber, L
.customerPhoneNumber(order.customerPhoneNumber)
.reservationTime(order.reservationTime)
.estimatedCookingTime(estimatedCookingTime)
.orderedAt(order.orderedAt)
.storeId(order.storeId)
.paymentId(order.paymentId)
.build();
Expand All @@ -87,6 +88,22 @@ public static Order of(Order order, OrderStatus status, String rejectReason) {
.customerPhoneNumber(order.customerPhoneNumber)
.reservationTime(order.reservationTime)
.rejectReason(rejectReason)
.orderedAt(order.orderedAt)
.storeId(order.storeId)
.paymentId(order.paymentId)
.build();
}

public static Order of(Order order, OrderStatus status) {
return Order.builder()
.id(order.id)
.orderNumber(order.orderNumber)
.status(status)
.requestedDetails(order.requestedDetails)
.totalPrice(order.totalPrice)
.customerPhoneNumber(order.customerPhoneNumber)
.reservationTime(order.reservationTime)
.orderedAt(order.orderedAt)
.storeId(order.storeId)
.paymentId(order.paymentId)
.build();
Expand Down

0 comments on commit 7294ac0

Please sign in to comment.