Skip to content

Commit

Permalink
Feat: coupon domain 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
marinesnow34 committed Nov 24, 2023
1 parent 3c9803f commit 454fa47
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/readyvery/readyverydemo/domain/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class Cart extends BaseTimeEntity {
@Builder.Default
private Boolean isDeleted = false;

@Builder.Default
@OneToMany(mappedBy = "cart")
private List<Order> orders = new ArrayList<Order>();

Expand Down
16 changes: 12 additions & 4 deletions src/main/java/com/readyvery/readyverydemo/domain/CouponDetail.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,25 @@ 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;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "event_idx")
private Event event;

@Builder.Default
@OneToMany(mappedBy = "couponDetail", cascade = CascadeType.ALL)
private List<CouponMenu> couponMenus = new ArrayList<CouponMenu>();
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "foodie_idx")
private Foodie foodie;

@Builder.Default
@OneToMany(mappedBy = "couponDetail", cascade = CascadeType.ALL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class Foodie extends BaseTimeEntity {
private List<CartItem> cartItems = new ArrayList<CartItem>();

@OneToMany(mappedBy = "foodie", cascade = CascadeType.ALL)
private List<CouponMenu> couponMenus = new ArrayList<CouponMenu>();
private List<CouponDetail> couponDetails = new ArrayList<CouponDetail>();

@OneToMany(mappedBy = "foodie", cascade = CascadeType.ALL)
private List<OrderItem> orderItems = new ArrayList<OrderItem>();
Expand Down

0 comments on commit 454fa47

Please sign in to comment.