-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…esign Refactor/#95 order design
- Loading branch information
Showing
37 changed files
with
631 additions
and
558 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
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
2 changes: 1 addition & 1 deletion
2
.../clothstar/order/type/ApprovalStatus.java → ...tar/order/domain/type/ApprovalStatus.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
2 changes: 1 addition & 1 deletion
2
...e/clothstar/order/type/PaymentMethod.java → ...star/order/domain/type/PaymentMethod.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
3 changes: 2 additions & 1 deletion
3
...rg/store/clothstar/order/type/Status.java → ...e/clothstar/order/domain/type/Status.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
2 changes: 1 addition & 1 deletion
2
...othstar/order/dto/reponse/AddressDTO.java → ...clothstar/order/domain/vo/AddressDTO.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
40 changes: 40 additions & 0 deletions
40
src/main/java/org/store/clothstar/order/domain/vo/OrderDetailDTO.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,40 @@ | ||
package org.store.clothstar.order.domain.vo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.store.clothstar.order.domain.OrderDetail; | ||
import org.store.clothstar.product.entity.ProductEntity; | ||
import org.store.clothstar.productLine.entity.ProductLineEntity; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class OrderDetailDTO { | ||
|
||
private Long orderDetailId; | ||
private String productName; // 상품명 | ||
private String optionName; | ||
private String brandName; | ||
private int productPrice; // 고정된 상품 가격 ( 주문 당시 가격 ) | ||
private int extraCharge; | ||
private int quantity; | ||
private int totalPrice; // 상품 종류 하나당 총 가격 | ||
|
||
public static OrderDetailDTO from(OrderDetail orderDetail, ProductEntity productEntity, ProductLineEntity productLineEntity){ | ||
|
||
return OrderDetailDTO.builder() | ||
.orderDetailId(orderDetail.getOrderDetailId()) | ||
.productName(productLineEntity.getName()) | ||
.optionName(productEntity.getName()) | ||
.brandName(productLineEntity.getSeller().getBrandName()) | ||
.productPrice(productLineEntity.getPrice()) | ||
.extraCharge(productEntity.getExtraCharge()) | ||
.quantity(orderDetail.getQuantity()) | ||
.totalPrice(orderDetail.getPrice().getOneKindTotalPrice()) | ||
.build(); | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
src/main/java/org/store/clothstar/order/domain/vo/Price.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,20 @@ | ||
package org.store.clothstar.order.domain.vo; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Embeddable | ||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Price { | ||
@Column(name = "fixed_price") | ||
private int fixedPrice; // 고정된 상품 가격 ( 주문 당시 가격 ) | ||
@Column(name = "onekind_total_price") | ||
private int oneKindTotalPrice; // 상품 종류 하나당 총 가격 | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/org/store/clothstar/order/domain/vo/TotalPrice.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 org.store.clothstar.order.domain.vo; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Embeddable | ||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class TotalPrice { | ||
@Column(name = "total_shipping_price") | ||
private int shipping; | ||
@Column(name = "total_products_price") | ||
private int products; | ||
@Column(name = "total_payment_price") | ||
private int payment; | ||
|
||
public void updatePrices(int totalProductsPrice, int totalPaymentPrice) { | ||
this.products = totalProductsPrice; | ||
this.payment = totalPaymentPrice; | ||
} | ||
} |
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
Oops, something went wrong.