Skip to content

Commit

Permalink
#270 fix: PaymentGetCounselorResponse에서 total 필드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
letskuku committed Oct 31, 2024
1 parent d46bdf9 commit b1d788e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,13 @@ public PaymentGetCounselorResponses getPaymentsByCounselor(Long paymentId, Strin
}

Pageable pageable = PageRequest.of(DEFAULT_PAGE_NUMBER, PAYMENT_COUNSELOR_PAGE_SIZE);
Long finalTotal = total;
Page<PaymentGetCounselorResponse> page =
(paymentId == 0 ?
paymentRepository.findAllByCounselorAndCounselorStatusAndUpdatedAtIsBefore(
counselor, counselorStatus, sortTime, pageable) :
paymentRepository.findAllByPaymentIdLessThanAndCounselorAndCounselorStatusAndUpdatedAtIsBefore(
paymentId, counselor, counselorStatus, sortTime, pageable))
.map(payment -> PaymentGetCounselorResponse.of(payment, finalTotal));
.map(PaymentGetCounselorResponse::of);

return PaymentGetCounselorResponses.of(total, page.getContent());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ public class PaymentGetCounselorResponse {
@Schema(description = "지급 계좌")
private final String account;

@Schema(description = "금액 합계")
private final Long total;

public static PaymentGetCounselorResponse of(Payment payment, Long total) {
public static PaymentGetCounselorResponse of(Payment payment) {
Consult consult = payment.getConsult();
Boolean isChat = consult.getChat() != null;

return new PaymentGetCounselorResponse(payment.getPaymentId(),
consult.getCustomer().getNickname(), isChat, consult.getCost() - FEE,
consult.getCost(), FEE, consult.getConsultedAt(), payment.getSettledAt(),
consult.getCounselor().getAccount(), total);
consult.getCounselor().getAccount());
}
}

0 comments on commit b1d788e

Please sign in to comment.