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

🐛 Amend product list and detail #61

Merged
merged 1 commit into from
Dec 29, 2023
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
Expand Up @@ -248,6 +248,7 @@ public static class ProductListItem {
private Long salesCount;
private Long reviewCount;
private Long averageRating;
private ProductSaleStatus productSaleStatus;

public static List<String> getProductIds(List<ProductListItem> productListItem) {
return productListItem.stream().map(ProductListItem::getKey).collect(Collectors.toList());
Expand Down Expand Up @@ -390,7 +391,7 @@ public static class StoreProductDetail {
private String productDescriptionImage;
private Long productSaleAmount;
private Double averageRating;
private String productSaleStatus;
private ProductSaleStatus productSaleStatus;
private ProductDetailFlower representativeFlower;
private List<ProductDetailFlower> flowers;

Expand Down Expand Up @@ -422,7 +423,7 @@ public static StoreProductDetail fromEntity(Product product, List<Flower> flower
.productDescriptionImage(product.getProductDescriptionImage())
.productSaleAmount(product.getProductSaleAmount())
.averageRating(product.getAverageRating())
.productSaleStatus(product.getProductSaleStatus().getMessage())
.productSaleStatus(product.getProductSaleStatus())
.representativeFlower(representativeFlower)
.flowers(flowerList)
.build();
Expand All @@ -440,7 +441,7 @@ public static class StoreProduct {
private Long productPrice;
private Long productSaleAmount;
private Double averageRating;
private String productSaleStatus;
private ProductSaleStatus productSaleStatus;

public static StoreProduct fromEntity(Product product, String representativeFlower) {
return StoreProduct.builder()
Expand All @@ -450,7 +451,7 @@ public static StoreProduct fromEntity(Product product, String representativeFlow
.productName(product.getProductName())
.productPrice(product.getProductPrice())
.productSaleAmount(product.getProductSaleAmount())
.productSaleStatus(product.getProductSaleStatus().getMessage())
.productSaleStatus(product.getProductSaleStatus())
.productThumbnail(product.getProductThumbnail())
.representativeFlower(representativeFlower)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ List<ProductFlowers> flowerRequestToFlowersList(
@Mapping(target = "productPrice", source = "product.productPrice"),
@Mapping(target = "reviewCount", source = "product.reviewCount"),
@Mapping(target = "averageRating", source = "product.averageRating"),
@Mapping(target = "productSaleStatus", source = "product.productSaleStatus"),
})
ProductListItem entityToListItem(Product product);

Expand Down
Loading