File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
src/main/java/com/trashheroesbe/feature/coupon/dto/response Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .trashheroesbe .feature .coupon .dto .response ;
2+
3+ import com .trashheroesbe .feature .coupon .domain .entity .Coupon ;
4+ import com .trashheroesbe .feature .coupon .domain .type .CouponType ;
5+ import com .trashheroesbe .feature .coupon .domain .type .DiscountType ;
6+ import java .time .LocalDateTime ;
7+
8+ public record PartnerCouponResponse (
9+ Long couponId ,
10+ String title ,
11+ String content ,
12+ CouponType type ,
13+ Integer pointCost ,
14+ DiscountType discountType ,
15+ Integer discountValue ,
16+ Integer totalStock ,
17+ Integer issuedCount ,
18+ Boolean isActive ,
19+ LocalDateTime createdAt ,
20+ LocalDateTime updatedAt
21+ ) {
22+
23+ public static PartnerCouponResponse from (Coupon coupon ) {
24+ return new PartnerCouponResponse (
25+ coupon .getId (),
26+ coupon .getTitle (),
27+ coupon .getContent (),
28+ coupon .getType (),
29+ coupon .getPointCost (),
30+ coupon .getDiscountType (),
31+ coupon .getDiscountValue (),
32+ coupon .getTotalStock (),
33+ coupon .getIssuedCount (),
34+ coupon .getIsActive (),
35+ coupon .getCreatedAt (),
36+ coupon .getUpdatedAt ()
37+ );
38+ }
39+ }
40+
You can’t perform that action at this time.
0 commit comments