Skip to content

Commit

Permalink
feat: 전체 상품 리스트 - 7일 이내 제품 new chip 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tteia committed Nov 4, 2024
1 parent 96288e2 commit 3786720
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import lombok.Builder;
import org.samtuap.inong.domain.product.entity.PackageProduct;

import java.time.LocalDateTime;

@Builder
public record AllPackageListResponse(@NotNull Long id,
@NotNull String packageName,
Expand All @@ -13,7 +15,8 @@ public record AllPackageListResponse(@NotNull Long id,
@NotNull Long price,
Long discountId,
Integer discount,
boolean discountActive
boolean discountActive,
LocalDateTime createdAt
) {
public static AllPackageListResponse fromEntity(PackageProduct product, String imageUrl, Long orderCount, Integer discount, boolean discountActive){
return AllPackageListResponse.builder()
Expand All @@ -26,6 +29,7 @@ public static AllPackageListResponse fromEntity(PackageProduct product, String i
.discountId(product.getDiscountId())
.discount(discount)
.discountActive(discountActive)
.createdAt(product.getCreatedAt())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.samtuap.inong.domain.discount.entity.Discount;
import org.samtuap.inong.domain.product.entity.PackageProduct;

import java.time.LocalDateTime;

@Builder
public record TopPackageGetResponse(@NotNull Long id,
@NotNull String packageName,
Expand All @@ -16,7 +18,8 @@ public record TopPackageGetResponse(@NotNull Long id,
@NotNull Integer deliveryCycle,
Long discountId,
Integer discount,
boolean discountActive) {
boolean discountActive,
LocalDateTime createdAt) {

public static TopPackageGetResponse fromEntity(PackageProduct packageProduct, String thumbnailUrl, Long orderCount, Integer discount, boolean discountActive) {
return TopPackageGetResponse.builder()
Expand All @@ -31,6 +34,7 @@ public static TopPackageGetResponse fromEntity(PackageProduct packageProduct, St
.discountId(packageProduct.getDiscountId())
.discount(discount)
.discountActive(discountActive)
.createdAt(packageProduct.getCreatedAt())
.build();
}

Expand Down

0 comments on commit 3786720

Please sign in to comment.