Skip to content

Commit a20cb9b

Browse files
committed
fix:code rabbit 이슈 수정
1 parent f6b9384 commit a20cb9b

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

nginx/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ http {
7373
# 프론트엔드 (임시 기본 페이지)
7474
location / {
7575
root /usr/share/nginx/html;
76-
try_files $uri /index.html;
76+
try_files $uri $uri/ /index.html;
7777
}
7878
}
7979
}

src/main/java/com/ongil/backend/domain/order/dto/response/RefundInfoDto.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ public record RefundInfoDto(
1111
@Schema(description = "배송비")
1212
Integer shippingFee,
1313

14-
@Schema(description = "환불 금액 (상품 금액 - 배송비)")
14+
@Schema(description = "사용 포인트 (복원 예정)")
15+
Integer usedPoints,
16+
17+
@Schema(description = "환불 금액 (실결제 금액 기준)")
1518
Integer refundAmount
1619
) {
1720
}

src/main/java/com/ongil/backend/domain/order/entity/Order.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ public void cancel(CancelReason cancelReason, String cancelDetail) {
101101
}
102102

103103
public void updateDeliveryAddress(String recipient, String recipientPhone,
104-
String deliveryAddress, String detailAddress, String postalCode) {
104+
String deliveryAddress, String detailAddress, String postalCode, String deliveryMessage) {
105105
this.recipient = recipient;
106106
this.recipientPhone = recipientPhone;
107107
this.deliveryAddress = deliveryAddress;
108108
this.detailAddress = detailAddress;
109109
this.postalCode = postalCode;
110+
this.deliveryMessage = deliveryMessage;
110111
}
111112
}

src/main/java/com/ongil/backend/domain/order/service/OrderService.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ public OrderDetailResponse updateDeliveryAddress(Long userId, Long orderId, Deli
217217
address.getRecipientPhone(),
218218
address.getBaseAddress(),
219219
address.getDetailAddress(),
220-
address.getPostalCode()
220+
address.getPostalCode(),
221+
address.getDeliveryRequest()
221222
);
222223

223224
List<OrderItemDto> itemDtos = orderConverter.toOrderItemDtos(order);
@@ -249,9 +250,16 @@ private RefundInfoDto calculateRefundInfo(Order order) {
249250
.mapToInt(item -> item.getPriceAtOrder() * item.getQuantity())
250251
.sum();
251252
int shippingFee = 0;
252-
int refundAmount = Math.max(productAmount - shippingFee, 0);
253253

254-
return new RefundInfoDto(productAmount, shippingFee, refundAmount);
254+
int usedPoints = 0;
255+
Payment payment = order.getPayment();
256+
if (payment != null && payment.getUsedPoints() != null) {
257+
usedPoints = payment.getUsedPoints();
258+
}
259+
260+
int refundAmount = Math.max(productAmount - shippingFee - usedPoints, 0);
261+
262+
return new RefundInfoDto(productAmount, shippingFee, usedPoints, refundAmount);
255263
}
256264

257265
public OrderHistoryResponse getOrderHistory(

0 commit comments

Comments
 (0)