Skip to content

Commit

Permalink
Merge pull request #160 from Make-A-Wish-Sopt/jiyoung_#159-account
Browse files Browse the repository at this point in the history
[FIX] 계좌 정보 추가 전달
  • Loading branch information
wlwpfh authored Dec 22, 2023
2 parents c18ad49 + 0666802 commit 7793c9a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,27 @@
import com.sopterm.makeawish.domain.wish.Wish;

import lombok.*;
import org.apache.commons.lang3.StringUtils;

@Builder
public record WishResponseDTO(String name, long dayCount, String title, String hint) {
public record WishResponseDTO(String name, long dayCount, String title, String hint, String bank, String accountNumber) {

public static WishResponseDTO from(Wish wish) {
val name = nonNull(wish.getWisher().getAccount())
? wish.getWisher().getAccount().getName()
: wish.getWisher().getNickname();

val account = nonNull(wish.getWisher().getAccount())
? wish.getWisher().getAccount().getAccount()
: StringUtils.EMPTY;
val bank = nonNull(wish.getWisher().getAccount())
? wish.getWisher().getAccount().getBank()
: StringUtils.EMPTY;

return WishResponseDTO.builder()
.name(name)
.accountNumber(account)
.bank(bank)
.dayCount(getRemainDayCount(wish.getEndAt()))
.title(wish.getTitle())
.hint(wish.getHint())
Expand Down

0 comments on commit 7793c9a

Please sign in to comment.