Skip to content

Commit

Permalink
#18 - Fix: Boolean -> boolean 타입으로 교체하여 default 로 false 값 들어가도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ahah525 committed Oct 26, 2022
1 parent 525c953 commit 880449d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class Order extends BaseEntity {

private String name; // 주문명
private LocalDateTime payDate; // 결제 일시
private Boolean readyStatus; // 주문완료 여부
private Boolean isPaid; // 결제완료 여부
private Boolean isCanceled; // 주문취소 여부
private Boolean isRefunded; // 환불 여부
private boolean readyStatus; // 주문완료 여부
private boolean isPaid; // 결제완료 여부
private boolean isCanceled; // 주문취소 여부
private boolean isRefunded; // 환불 여부

@Builder.Default
@OneToMany(mappedBy = "order", cascade = CascadeType.ALL, orphanRemoval = true)
Expand All @@ -44,7 +44,7 @@ public void makeName() {
String name = orderItems.get(0).getProduct().getSubject();
// 2건 이상일 경우 1번 주문 품목 제목 외 ?건 형식으로
if(orderItems.size() > 1) {
name += " 외 %d건".formatted(orderItems.size() - 1);
name += " 외 %d개".formatted(orderItems.size() - 1);
}
this.name = name;
}
Expand All @@ -55,12 +55,12 @@ public void setOrderDone() {
}

// 총 주문(상품) 금액
public long getTotalPayPrice() {
public long getPayPrice() {
// 상품들의 실제 판매가의 총합
long totalPayPrice = 0;
long payPrice = 0;
for(OrderItem orderItem : orderItems) {
totalPayPrice += orderItem.getSalePrice();
payPrice += orderItem.getSalePrice();
}
return totalPayPrice;
return payPrice;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ public class OrderItem extends BaseEntity {
private int pgFee; // 결제대행사 수수료
private int payPrice; // 결제 금액
private int refundPrice; // 환불 금액
private Boolean isPaid; // 결제 여부
private boolean isPaid; // 결제 여부

public OrderItem(Product product) {
// product 로 부터 가져온 값
this.product = product;
this.price = product.getPrice();
this.salePrice = product.getSalePrice();
this.wholesalePrice = product.getWholesalePrice();
}
}

0 comments on commit 880449d

Please sign in to comment.