Skip to content

Commit

Permalink
[#172] feat(Promotion): promotion entity에 추가로 필요한 필드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyerinhwang-sailin committed Aug 13, 2024
1 parent 80136b3 commit ca3c4b4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/com/beat/domain/promotion/domain/Promotion.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,29 @@ public class Promotion {
private String promotionPhoto;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "performance_id", nullable = false)
@JoinColumn(name = "performance_id", nullable = true)
private Performance performance;

@Column(nullable = true)
private String redirectUrl;

@Column(nullable = false)
private boolean isExternal;

@Builder
public Promotion(String promotionPhoto, Performance performance) {
public Promotion(String promotionPhoto, Performance performance, String redirectUrl, boolean isExternal) {
this.promotionPhoto = promotionPhoto;
this.performance = performance;
this.redirectUrl = redirectUrl;
this.isExternal = isExternal;
}

public static Promotion create(String promotionPhoto, Performance performance) {
public static Promotion create(String promotionPhoto, Performance performance, String redirectUrl, boolean isExternal) {
return Promotion.builder()
.promotionPhoto(promotionPhoto)
.performance(performance)
.redirectUrl(redirectUrl)
.isExternal(isExternal)
.build();
}
}

0 comments on commit ca3c4b4

Please sign in to comment.