Skip to content

Commit

Permalink
Merge pull request #207 from Make-A-Wish-Sopt/feature/jiyoung-#206
Browse files Browse the repository at this point in the history
[FIX] 소원 생성 시 변수값 수정
  • Loading branch information
wlwpfh authored Nov 11, 2024
2 parents 38aa82b + 0abf170 commit a459b1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/sopterm/makeawish/domain/wish/Wish.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Wish extends BaseEntity {
private LocalDateTime endAt;

private int totalPrice;
private String hint;

@ManyToOne(fetch = LAZY)
@JoinColumn(name = "user_id")
Expand All @@ -51,13 +52,14 @@ public class Wish extends BaseEntity {

@Builder
public Wish(String title, String presentImageUrl, LocalDateTime startAt,
LocalDateTime endAt, User wisher, boolean wantsGift) {
LocalDateTime endAt, User wisher, boolean wantsGift, String hint) {
this.title = title;
this.presentImageUrl = presentImageUrl;
this.startAt = startAt;
this.endAt = endAt;
this.totalPrice = 0;
this.wantsGift = wantsGift;
this.hint = hint;
setWisher(wisher);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ public record WishRequestDTO(
String startDate,
String endDate,
String phone,
boolean wantsGift
boolean wantsGift,
String hint
) {

public Wish toEntity(User wisher) {
wisher.updatePhoneNumber(phone);
return Wish.builder()
.presentImageUrl(imageUrl)
.hint(hint)
.title(title)
.startAt(convertToDate(startDate))
.endAt(convertToDate(endDate))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static WishResponseDTO from(Wish wish) {
.bank(bank)
.dayCount(getRemainDayCount(wish.getEndAt()))
.title(wish.getTitle())
.hint(wish.getHint())
.wantsGift(wish.isWantsGift())
.presentImageUrl(wish.getPresentImageUrl())
.build();
Expand Down

0 comments on commit a459b1d

Please sign in to comment.