diff --git a/src/main/java/com/readyvery/readyverydemo/domain/Cart.java b/src/main/java/com/readyvery/readyverydemo/domain/Cart.java index d3ac2d5..e1c444b 100644 --- a/src/main/java/com/readyvery/readyverydemo/domain/Cart.java +++ b/src/main/java/com/readyvery/readyverydemo/domain/Cart.java @@ -56,6 +56,7 @@ public class Cart extends BaseTimeEntity { @Builder.Default private Boolean isDeleted = false; + @Builder.Default @OneToMany(mappedBy = "cart") private List orders = new ArrayList(); diff --git a/src/main/java/com/readyvery/readyverydemo/domain/CouponDetail.java b/src/main/java/com/readyvery/readyverydemo/domain/CouponDetail.java index 2157f16..7fad25d 100644 --- a/src/main/java/com/readyvery/readyverydemo/domain/CouponDetail.java +++ b/src/main/java/com/readyvery/readyverydemo/domain/CouponDetail.java @@ -46,7 +46,15 @@ public class CouponDetail extends BaseTimeEntity { @Column private LocalDateTime expire; - // 발행처 레디베리 발행(0) / 사장님 발행(ceo_idx) + // 쿠폰 코드 + @Column(name = "coupon_code") + private String couponCode; + + // 발급 갯수 + @Column(name = "coupon_count") + private Long couponCount; + + // 발행처 레디베리 발행(0) / 사장님 발행(store_idx) @Column private Long publisher; @@ -54,9 +62,9 @@ public class CouponDetail extends BaseTimeEntity { @JoinColumn(name = "event_idx") private Event event; - @Builder.Default - @OneToMany(mappedBy = "couponDetail", cascade = CascadeType.ALL) - private List couponMenus = new ArrayList(); + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "foodie_idx") + private Foodie foodie; @Builder.Default @OneToMany(mappedBy = "couponDetail", cascade = CascadeType.ALL) diff --git a/src/main/java/com/readyvery/readyverydemo/domain/CouponMenu.java b/src/main/java/com/readyvery/readyverydemo/domain/CouponMenu.java index 53eddbb..cb0cfc3 100644 --- a/src/main/java/com/readyvery/readyverydemo/domain/CouponMenu.java +++ b/src/main/java/com/readyvery/readyverydemo/domain/CouponMenu.java @@ -32,8 +32,4 @@ public class CouponMenu extends BaseTimeEntity { @JoinColumn(name = "coupon_detail_idx") private CouponDetail couponDetail; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "foodie_idx") - private Foodie foodie; - } diff --git a/src/main/java/com/readyvery/readyverydemo/domain/Foodie.java b/src/main/java/com/readyvery/readyverydemo/domain/Foodie.java index bfa78d7..6436b7f 100644 --- a/src/main/java/com/readyvery/readyverydemo/domain/Foodie.java +++ b/src/main/java/com/readyvery/readyverydemo/domain/Foodie.java @@ -76,7 +76,7 @@ public class Foodie extends BaseTimeEntity { private List cartItems = new ArrayList(); @OneToMany(mappedBy = "foodie", cascade = CascadeType.ALL) - private List couponMenus = new ArrayList(); + private List couponDetails = new ArrayList(); @OneToMany(mappedBy = "foodie", cascade = CascadeType.ALL) private List orderItems = new ArrayList();