Skip to content

Commit

Permalink
feat: 쿠폰 조회 API 응답에 쿠폰 종류 필드 추가 (#865)
Browse files Browse the repository at this point in the history
feat: 쿠폰 조회 응답에 쿠폰 종류 필드 추가
  • Loading branch information
Sangwook02 authored Feb 2, 2025
1 parent 1f4bc90 commit f66fc6f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
import java.math.BigDecimal;
import java.time.LocalDateTime;

public record CouponResponse(Long couponId, String name, BigDecimal discountAmount, LocalDateTime createdAt) {
public record CouponResponse(
Long couponId, String name, BigDecimal discountAmount, LocalDateTime createdAt, String couponType) {
public static CouponResponse from(Coupon coupon) {
return new CouponResponse(
coupon.getId(), coupon.getName(), coupon.getDiscountAmount().getAmount(), coupon.getCreatedAt());
coupon.getId(),
coupon.getName(),
coupon.getDiscountAmount().getAmount(),
coupon.getCreatedAt(),
coupon.getCouponType().getValue());
}
}

0 comments on commit f66fc6f

Please sign in to comment.