-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] 결제 취소 기능 및 결제 내역 조회 기능 구현 #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
EndlessMilkyway
merged 9 commits into
develop
from
feature/211-payment-cancel-and-history-implementation
Aug 6, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
865564d
feat: 결제 내역 조회 시 사용할 프로젝션 구현 (#211)
EndlessMilkyway 83c245f
feat: 결제 내역 조회 시 QueryDSL을 사용하기 위해 리파지토리 인터페이스 구현 (#211)
EndlessMilkyway b598596
feat: QueryDSL 인터페이스에 대한 클래스 구현 (#211)
EndlessMilkyway 4381aaf
feat: Payment 리파지토리 레이어에 QueryDSL 리파지토리 상속관계 추가 (#211)
EndlessMilkyway 18dedd5
feat: 결제 취소 컨트롤러 레이어 구현 (#211)
EndlessMilkyway d9e6c36
feat: 결제 취소 및 환불 서비스 레이어 구현 (#211)
EndlessMilkyway 4096711
refactor: 예약 상태를 취소로 변경하는 메서드 이동 (#211)
EndlessMilkyway eefbf1c
refactor: 결제 내역 조회 컨트롤러 레이어 구현 (#211)
EndlessMilkyway 6e13581
refactor: 결제 내역 조회 서비스 레이어 구현 (#211)
EndlessMilkyway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/com/sudo/railo/payment/application/dto/projection/PaymentProjection.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package com.sudo.railo.payment.application.dto.projection; | ||
|
|
||
| import java.math.BigDecimal; | ||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.querydsl.core.annotations.QueryProjection; | ||
| import com.sudo.railo.payment.domain.status.PaymentStatus; | ||
| import com.sudo.railo.payment.domain.type.PaymentMethod; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public class PaymentProjection { | ||
|
|
||
| private final Long paymentId; | ||
| private final String paymentKey; | ||
| private final String reservationCode; | ||
| private final BigDecimal amount; | ||
| private final PaymentMethod paymentMethod; | ||
| private final PaymentStatus paymentStatus; | ||
| private final LocalDateTime paidAt; | ||
| private final LocalDateTime cancelledAt; | ||
| private final LocalDateTime refundedAt; | ||
|
|
||
| @QueryProjection | ||
| public PaymentProjection(Long paymentId, String paymentKey, String reservationCode, | ||
| BigDecimal amount, PaymentMethod paymentMethod, PaymentStatus paymentStatus, | ||
| LocalDateTime paidAt, LocalDateTime cancelledAt, LocalDateTime refundedAt) { | ||
| this.paymentId = paymentId; | ||
| this.paymentKey = paymentKey; | ||
| this.reservationCode = reservationCode; | ||
| this.amount = amount; | ||
| this.paymentMethod = paymentMethod; | ||
| this.paymentStatus = paymentStatus; | ||
| this.paidAt = paidAt; | ||
| this.cancelledAt = cancelledAt; | ||
| this.refundedAt = refundedAt; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/com/sudo/railo/payment/infrastructure/PaymentRepositoryCustom.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.sudo.railo.payment.infrastructure; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import com.sudo.railo.payment.application.dto.projection.PaymentProjection; | ||
|
|
||
| public interface PaymentRepositoryCustom { | ||
|
|
||
| /** | ||
| * 회원의 결제 히스토리를 프로젝션으로 조회 (가장 효율적) | ||
| * | ||
| * @param memberId 회원 ID | ||
| * @return PaymentHistoryResponse 리스트 (필요한 필드만 조회) | ||
| */ | ||
| List<PaymentProjection> findPaymentHistoryByMemberId(Long memberId); | ||
| } |
42 changes: 42 additions & 0 deletions
42
src/main/java/com/sudo/railo/payment/infrastructure/PaymentRepositoryCustomImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package com.sudo.railo.payment.infrastructure; | ||
|
|
||
| import static com.sudo.railo.booking.domain.QReservation.*; | ||
| import static com.sudo.railo.member.domain.QMember.*; | ||
| import static com.sudo.railo.payment.domain.QPayment.*; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| import com.querydsl.jpa.impl.JPAQueryFactory; | ||
| import com.sudo.railo.payment.application.dto.projection.PaymentProjection; | ||
| import com.sudo.railo.payment.application.dto.projection.QPaymentProjection; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Repository | ||
| @RequiredArgsConstructor | ||
| public class PaymentRepositoryCustomImpl implements PaymentRepositoryCustom { | ||
|
|
||
| private final JPAQueryFactory queryFactory; | ||
|
|
||
| @Override | ||
| public List<PaymentProjection> findPaymentHistoryByMemberId(Long memberId) { | ||
| return queryFactory | ||
| .select(new QPaymentProjection( | ||
| payment.id, | ||
| payment.paymentKey, | ||
| reservation.reservationCode, | ||
| payment.amount, | ||
| payment.paymentMethod, | ||
| payment.paymentStatus, | ||
| payment.paidAt, | ||
| payment.cancelledAt, | ||
| payment.refundedAt)) | ||
| .from(payment) | ||
| .join(payment.member, member) | ||
| .join(payment.reservation, reservation) | ||
| .where(payment.member.id.eq(memberId)) | ||
| .orderBy(payment.paidAt.desc()).fetch(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.