Skip to content

Commit 21dc4d2

Browse files
committed
refactor: 랭킹 API 의 상품 응답 스펙에 재고에 따른 특정 결과만 포함하도록 수정
1 parent ee16413 commit 21dc4d2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/commerce-api/src/main/java/com/loopers/application/rank/RankingInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public record RankingInfo(
66
Long productId,
77
String productName,
88
Long price,
9-
int stock,
9+
boolean isSoldOut,
1010
int currentRank
1111
) {
1212

@@ -15,7 +15,7 @@ public static RankingInfo of(Product product, int currentRank) {
1515
product.getId(),
1616
product.getName(),
1717
product.getPrice().getValue(),
18-
product.getStock(),
18+
product.getStock() <= 0,
1919
currentRank
2020
);
2121
}

apps/commerce-api/src/main/java/com/loopers/interfaces/api/rank/RankingV1Dto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public record RankingResponse(
88
Long productId,
99
String productName,
1010
Long price,
11-
int stock,
11+
boolean isSoldOut,
1212
int currentRank
1313
) {
1414

@@ -17,7 +17,7 @@ public static RankingResponse from(RankingInfo info) {
1717
info.productId(),
1818
info.productName(),
1919
info.price(),
20-
info.stock(),
20+
info.isSoldOut(),
2121
info.currentRank()
2222
);
2323
}

0 commit comments

Comments
 (0)