Skip to content

Commit

Permalink
Merge pull request #246 from readyvery/test
Browse files Browse the repository at this point in the history
축제용 배포
  • Loading branch information
marinesnow34 authored May 19, 2024
2 parents 4f984b1 + 28de5fb commit e500fa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@Getter
@RequiredArgsConstructor
public enum Grade {

EVENT("EVENT", 0.0D),
ORDA("ORDA", 4.0D),
DEFAULT("Earlier", 6.3D);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.readyvery.readyverydemo.src.coupon.dto;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.stereotype.Component;
Expand All @@ -16,6 +17,7 @@ public CouponsRes toCouponsRes(List<Coupon> coupons) {
//filter로 isUsed가 false인 쿠폰만 가져옴
.coupons(coupons.stream()
.filter(coupon -> coupon.getIssueCount() - coupon.getUseCount() > 0)
.filter(coupon -> coupon.getCouponDetail().getExpire().isAfter(LocalDateTime.now()))
.map(this::toCouponDto)
.toList())
.build();
Expand All @@ -27,7 +29,6 @@ private CouponDto toCouponDto(Coupon coupon) {
.couponName(coupon.getCouponDetail().getName())
.description(coupon.getCouponDetail().getDescription())
.expirationDate(coupon.getCouponDetail().getExpire())
.leftCoupon(coupon.getIssueCount() - coupon.getUseCount())
.publisher(coupon.getCouponDetail().getStore() == null
? "레디베리" : coupon.getCouponDetail().getStore().getName())
.salePrice(coupon.getCouponDetail().getSalePrice())
Expand Down

0 comments on commit e500fa1

Please sign in to comment.