Skip to content

[Feature] [상점] 주문 상세 및 정산내역 CRUD#205

Merged
Moses249 merged 15 commits into
developfrom
feature/#112-store-sales-crud
Oct 29, 2025
Merged

[Feature] [상점] 주문 상세 및 정산내역 CRUD#205
Moses249 merged 15 commits into
developfrom
feature/#112-store-sales-crud

Conversation

@Moses249

Copy link
Copy Markdown
Contributor

🛠️ Issue Number

closes #112

주문 상세

  • 한 주문에 대한 상세 내역 구현

정산 내역

  • 전체 주문 목록 구현 (환불 포함)
  • 환불된 상품은 환불 상태, 구매한 상품은 결제 상태가 반환되도록 구현

📌 작업 내용 및 특이사항

  • payment merge 후 충돌 or 수정사항 해결 예정
  • sales는 order 패키지 안에 구현
  • sales(정산) 서비스는 분리하였으나, 컨트롤러도 분리할지

📚 참고사항

  • 오류 다수 예상....

@Moses249 Moses249 added this to the Sprint1 milestone Oct 26, 2025
@Moses249 Moses249 self-assigned this Oct 26, 2025

@isak-kang isak-kang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!
수정사항 확인 부탁드립니다!

List.of(
OrderStatus.DELIVERED,
OrderStatus.PARTIALLY_DELIVERED,
OrderStatus.DELIVERED,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p1 : OrderStatus.DELIVERED가 중복 되어 있습니다!

@Bal1oon Bal1oon modified the milestones: Sprint1, Sprint 3 Oct 26, 2025
@Bal1oon Bal1oon added the ✨ feature 새 기능을 추가합니다. label Oct 26, 2025

@Bal1oon Bal1oon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적인 흐름은 잘 잡혀있는 것 같습니다.
Controller는 분리하는게 좋을 거 같아요.

코멘트 확인해주시고, 다가오는 주에 리팩토링 전체적으로 하시죠 :)

Comment thread src/main/java/com/irum/come2us/domain/order/application/service/SalesService.java Outdated
정산 내역 조회시 환불 내역이 있으면 환불 상태 반환, 그렇지 않으면 주문 상태 반환
정산 내역 조회시 환불 내역이 있으면 환불 상태 반환, 그렇지 않으면 주문 상태 반환 및 기타 수정
@Moses249
Moses249 requested review from Bal1oon and isak-kang October 27, 2025 07:56

@willjsw willjsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정사항 확인해주세요!

int updateStatusToFailedByIds(@Param("paymentIds") List<UUID> paymentIds);

@Query("SELECT ac FROM AppliedCoupon ac JOIN ac.payment p WHERE p.id = :paymentId")
List<AppliedCoupon> findByPayment_Id(@Param("paymentId") UUID paymentId);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: 자바 네이밍 컨벤션 지켜주세요! 카멜케이스로 작성하셔야합니다

@JoinColumn(name = "member_id")
private Member member;

@OneToMany(mappedBy = "payment", fetch = FetchType.LAZY)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: 결제 삭제 시 해당 결제에 사용된 쿠폰 리스트도 삭제될 수 있도록 cascade와 orphanRemoval 설정해주세요!

@Query("UPDATE Payment p SET p.paymentStatus = 'FAILED' WHERE p.paymentId IN :paymentIds")
int updateStatusToFailedByIds(@Param("paymentIds") List<UUID> paymentIds);

@Query("SELECT ac FROM AppliedCoupon ac JOIN ac.payment p WHERE p.id = :paymentId")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: 현재 PaymentRepository에서 AppliedCoupon 타입 배열 반환값을 조회하고 있는데, 타입 불일치로 오류가 날 것 같습니다. AppliedCouponRepostory로 로직을 옮겨주세요!
또한 PaymentId가 Where을 통해 비교되고 있으므로, N+1 해결을 위해 fetch Join 을 적용하지 않는 이상 2개 테이블간 외래키를 통해 조회할 떄 명시적인 Join은 필요하지 않을 것 같습니다. JPA 추론을 통한 기본 메서드를 사용하셔도 될 것 같네요

@Bal1oon Bal1oon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@willjsw willjsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@Moses249
Moses249 merged commit 754a13f into develop Oct 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature 새 기능을 추가합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 상점용 주문 상세 CRUD 구현

4 participants