Skip to content

Commit fb73044

Browse files
authored
Merge pull request #66 from 9oormthon-univ/feat/qrcode
Feat: 파트너가 발급한 쿠폰 전체 조회기능 추가
2 parents c9a8cb6 + fecc93c commit fb73044

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

0 commit comments

Comments
 (0)