Skip to content

Commit

Permalink
Merge pull request #273 from sharemindteam/fix/270-counselor-payment
Browse files Browse the repository at this point in the history
fix: 마인더 수익 관리 dto 필드 오류 수정
letskuku authored Oct 31, 2024
2 parents d46bdf9 + b1d788e commit ea75121
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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());
}
Original file line number Diff line number Diff line change
@@ -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 ea75121

Please sign in to comment.