Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…OONG_TEAM_42_BE into develop
  • Loading branch information
ryuwon2407 committed Nov 23, 2024
2 parents e0a69fa + 237d658 commit b07a409
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
public record PaymentPageResponse(
Integer totalPoint,
Integer totalPay,
Integer percent
Integer percent,
String customImage
) {
public static PaymentPageResponse of(Card card, User user, Store store) {
return PaymentPageResponse.builder()
.totalPoint(card.getTotalPoint())
.totalPay(user.getPay().getTotalPay())
.percent(store.getPercent())
.customImage(card.getCustomImage())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Pay extends BaseEntity {
private Integer totalPay;

// 유저 id
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "user_id")
private User user;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/groom/swipo/domain/user/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class User extends BaseEntity {
private List<Card> Cards = new ArrayList<>();

// 페이
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "pay_id")
private Pay pay;

Expand Down

0 comments on commit b07a409

Please sign in to comment.