File tree 1 file changed +2
-1
lines changed
src/main/java/com/readyvery/readyverydemo/src/coupon/dto
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com .readyvery .readyverydemo .src .coupon .dto ;
2
2
3
+ import java .time .LocalDateTime ;
3
4
import java .util .List ;
4
5
5
6
import org .springframework .stereotype .Component ;
@@ -16,6 +17,7 @@ public CouponsRes toCouponsRes(List<Coupon> coupons) {
16
17
//filter로 isUsed가 false인 쿠폰만 가져옴
17
18
.coupons (coupons .stream ()
18
19
.filter (coupon -> coupon .getIssueCount () - coupon .getUseCount () > 0 )
20
+ .filter (coupon -> coupon .getCouponDetail ().getExpire ().isAfter (LocalDateTime .now ()))
19
21
.map (this ::toCouponDto )
20
22
.toList ())
21
23
.build ();
@@ -27,7 +29,6 @@ private CouponDto toCouponDto(Coupon coupon) {
27
29
.couponName (coupon .getCouponDetail ().getName ())
28
30
.description (coupon .getCouponDetail ().getDescription ())
29
31
.expirationDate (coupon .getCouponDetail ().getExpire ())
30
- .leftCoupon (coupon .getIssueCount () - coupon .getUseCount ())
31
32
.publisher (coupon .getCouponDetail ().getStore () == null
32
33
? "레디베리" : coupon .getCouponDetail ().getStore ().getName ())
33
34
.salePrice (coupon .getCouponDetail ().getSalePrice ())
You can’t perform that action at this time.
0 commit comments