Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 포인트 내역 조회에서 날짜를 String 형식으로 통일해서 다룸 #197

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.backoffice.upjuyanolja.domain.point.dto.response;

import com.backoffice.upjuyanolja.domain.point.entity.PointCharges;
import java.time.format.DateTimeFormatter;
import lombok.Builder;

@Builder
Expand All @@ -16,7 +17,7 @@ public static PointChargeResponse of(
) {
return PointChargeResponse.builder()
.orderId(pointCharges.getOrderName())
.tradeAt(pointCharges.getChargeDate().toString())
.tradeAt(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(pointCharges.getChargeDate()))
.orderName(pointCharges.getChargePoint()+"원")
.amount(pointCharges.getChargePoint())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public record PointTotalDetailResponse(
String description,
long trade,
long amount,
LocalDateTime date,
String date,
Object receipt

) {

public static PointTotalDetailResponse of(
String category, String type, String status,
String name, String description, long trade,
long amount, LocalDateTime date, Object receipt
long amount, String date, Object receipt
) {
return PointTotalDetailResponse.builder()
.category(category)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.time.LocalDateTime;
import java.time.YearMonth;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Comparator;
Expand Down Expand Up @@ -202,7 +203,7 @@ public PointTotalPageResponse getTotalPointPageResponse(Long memberId, Pageable
"",
charge.trade(),
charge.amount(),
LocalDateTime.parse(charge.receipt().tradeAt()),
charge.receipt().tradeAt(),
charge.receipt()
));
}
Expand All @@ -215,7 +216,7 @@ public PointTotalPageResponse getTotalPointPageResponse(Long memberId, Pageable
usage.description(),
usage.trade(),
usage.amount(),
LocalDateTime.parse(usage.receipt().tradeAt()),
usage.receipt().tradeAt(),
usage.receipt()
));
}
Expand Down Expand Up @@ -416,14 +417,14 @@ private PointChargeReceiptResponse getPointChargeReceiptResponse(
case REMAINED:
return PointChargeReceiptResponse.of(
pointCharges.getOrderName(),
pointCharges.getChargeDate().toString(),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(pointCharges.getChargeDate()),
pointCharges.getChargePoint()
);
case CANCELED:
PointRefunds pointRefund = pointRefundsRepository.findByPointCharges(pointCharges);
return PointChargeReceiptResponse.of(
pointCharges.getOrderName(),
pointRefund.getRefundDate().toString(),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(pointRefund.getRefundDate()),
pointCharges.getChargePoint()
);
default:
Expand Down Expand Up @@ -500,7 +501,8 @@ private PointUsageReceiptResponse getPointUsageReceiptResponse(
Map<Room, List<Coupon>> couponIssuancesMap, List<CouponIssuance> couponIssuances
) {
return PointUsageReceiptResponse.of(
getPointUsageReceiptOrderId(), pointUsages.getOrderDate().toString(),
getPointUsageReceiptOrderId(),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(pointUsages.getOrderDate()),
accommodationName,
getPointUsageDetailReceiptResponse(couponIssuancesMap, couponIssuances)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Content-Type: application/json

###

GET http://localhost:8080/api/points/total
GET http://localhost:8080/api/points/total-balance
Accept: application/json
Authorization: Bearer {{access_token}}