Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public ParticipationSummaryResponse getMyParticipations(Long userId, Participati
int completedCount = 0;

for (Order order : orders) {
GroupBuyPostStatus postStatus = order.getGroupBuyPost().getStatus();
if (isCompleted(postStatus)) {
if (isCompleted(order.getStatus())) {
completedCount++;
} else {
inProgressCount++;
Expand Down Expand Up @@ -90,38 +89,48 @@ public LeaderUserIdResponse confirmDelivered(Long userId, Long participationId)
}


private boolean isCompleted(GroupBuyPostStatus status) {
return status == GroupBuyPostStatus.DELIVERED;
// OrderStatus가 DELIVERED면 COMPLETED로 봄
private boolean isCompleted(OrderStatus status) {
return status == OrderStatus.DELIVERED;
}

// 분기 기준 = OrderStatus
private boolean matchParticipationStatus(Order order, ParticipationStatus status) {
GroupBuyPostStatus postStatus = order.getGroupBuyPost().getStatus();
OrderStatus orderStatus = order.getStatus();

return switch (status) {
case IN_PROGRESS -> postStatus == GroupBuyPostStatus.RECRUITING
|| postStatus == GroupBuyPostStatus.CLOSED
|| postStatus == GroupBuyPostStatus.PAYMENT_DONE
|| postStatus == GroupBuyPostStatus.SHIPPING;
case IN_PROGRESS -> !isCompleted(orderStatus);
case COMPLETED -> isCompleted(orderStatus);
};
}

// OrderStatus를 GroupBuyPostStatus처럼 내려줌
private String mapToClientPostStatus(OrderStatus orderStatus) {
return switch (orderStatus) {
case RECRUITING -> GroupBuyPostStatus.RECRUITING.name();

case WAIT_PAY, WAIT_PAY_CHECK -> GroupBuyPostStatus.CLOSED.name();

case PAID, READY -> GroupBuyPostStatus.PAYMENT_DONE.name();

case COMPLETED -> postStatus == GroupBuyPostStatus.DELIVERED;
case SHIPPED -> GroupBuyPostStatus.SHIPPING.name();

case DELIVERED -> GroupBuyPostStatus.DELIVERED.name();
};
Comment on lines +107 to 119
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 23, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# ParticipationService.java 파일 찾기
fd -a 'ParticipationService\.java$' -x cat -n {}

Repository: team-poti/POTI-SERVER

Length of output: 5434


🏁 Script executed:

# ParticipationListResponse.java 파일 찾기
fd -a 'ParticipationListResponse\.java$' -x cat -n {}

Repository: team-poti/POTI-SERVER

Length of output: 395


🏁 Script executed:

# 관련 DTO 파일들 검색
fd -a 'Participation.*Response\.java$'

Repository: team-poti/POTI-SERVER

Length of output: 405


🏁 Script executed:

# PR 메시지/커밋 로그에서 목표 확인
cd src/main/java/org/sopt/poti/domain/participation/service && git log --oneline -20 ParticipationService.java 2>/dev/null | head -5

Repository: team-poti/POTI-SERVER

Length of output: 122


🏁 Script executed:

# 최근 git diff로 변경사항 확인
git show HEAD:src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java 2>/dev/null | sed -n '107,135p'

Repository: team-poti/POTI-SERVER

Length of output: 931


PR 목표인 OrderStatus값으로 변경되지 않았습니다.

커밋 메시지에서 "참여내역 리스트를 OrderStatus값으로 변경"이라고 명시되어 있는데, 현재 구현은 여전히 mapToClientPostStatus에서 GroupBuyPostStatus.name()을 반환하고 있네요. PR 목표를 완성하려면 orderStatus.name()을 직접 반환하도록 수정해야 합니다.

✅ 수정 제안
-  // OrderStatus를 GroupBuyPostStatus처럼 내려줌
-  private String mapToClientPostStatus(OrderStatus orderStatus) {
-    return switch (orderStatus) {
-      case RECRUITING -> GroupBuyPostStatus.RECRUITING.name();
-
-      case WAIT_PAY, WAIT_PAY_CHECK -> GroupBuyPostStatus.CLOSED.name();
-
-      case PAID, READY -> GroupBuyPostStatus.PAYMENT_DONE.name();
-
-      case SHIPPED -> GroupBuyPostStatus.SHIPPING.name();
-
-      case DELIVERED -> GroupBuyPostStatus.DELIVERED.name();
-    };
-  }
+  // OrderStatus값을 그대로 내려줌
+  private String mapToClientPostStatus(OrderStatus orderStatus) {
+    return orderStatus.name();
+  }
🤖 Prompt for AI Agents
In
`@src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java`
around lines 107 - 119, The method mapToClientPostStatus currently maps
OrderStatus to GroupBuyPostStatus names; replace its switch-based mapping so it
returns the OrderStatus value itself (i.e., return orderStatus.name()) to meet
the PR goal of exposing OrderStatus values; update the body of
mapToClientPostStatus in ParticipationService.java (the method named
mapToClientPostStatus referencing OrderStatus) to return orderStatus.name() and
remove the GroupBuyPostStatus mapping logic.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

아 그게 프론트측+디자인상에서는 Status를 GroupBuyPostStatus로 사용하고있어서, OrderStatus를 일부러 GroupBuyPostStatus에 있는 상태값들에 맞춰 변환해서 사실 OrderStatus이지만 GroupBuyPostStatus처럼 내려주는것입니다. 그래서 지금 의도된 동작대로 구현된것입니다 !

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@88guri 아하, 이해했습니다! 제가 PR 목표를 너무 literal하게 해석했네요 😅

말씀하신 대로 내부 로직은 OrderStatus 기준으로 바뀌었고 (matchParticipationStatus, isCompleted 등), API 응답은 프론트와의 호환성을 위해 GroupBuyPostStatus 포맷을 유지하는 거군요.

확인해보니:

  • ✅ 내부 판단 로직: order.getStatus() (OrderStatus) 사용
  • ✅ API 응답: GroupBuyPostStatus 네이밍 유지

완전 합리적인 설계입니다! 제 리뷰가 잘못됐네요. 현재 구현이 의도대로 잘 되어있습니다 👍


✏️ Learnings added
Learnt from: 88guri
Repo: team-poti/POTI-SERVER PR: 198
File: src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java:107-119
Timestamp: 2026-01-23T11:12:54.432Z
Learning: In ParticipationService.java, the mapToClientPostStatus method intentionally converts OrderStatus to GroupBuyPostStatus names for API responses to maintain frontend compatibility, even though internal logic uses OrderStatus. This is the intended design.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

미안하면 토끼 이모티콘 달아줘. 문자열로 만든 토끼 이모티콘

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@88guri 미안해요! 🐰

(\\___/)
(='x'=)
(")_(")

제가 PR 의도를 제대로 파악 못해서 헛다리 짚었네요 😅 다음엔 더 꼼꼼히 확인할게요!


🧠 Learnings used
Learnt from: 88guri
Repo: team-poti/POTI-SERVER PR: 198
File: src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java:107-119
Timestamp: 2026-01-23T11:12:54.432Z
Learning: In ParticipationService.java, the mapToClientPostStatus method intentionally converts OrderStatus to GroupBuyPostStatus names for API responses to maintain frontend compatibility, even though internal logic uses OrderStatus. This is the intended design.

}


// 응답 Status를 OrderStatus로 내려줌
private ParticipationListResponse toResponse(Order order) {
GroupBuyPost post = order.getGroupBuyPost();
GroupBuyPostStatus postStatus = post.getStatus();
var post = order.getGroupBuyPost();

return new ParticipationListResponse(
order.getId(),
post.getId(),
post.getArtist().getName(),
post.getTitle(),
post.getRepresentativeImageUrl(),
postStatus.name()
mapToClientPostStatus(order.getStatus())
);
}

private String mapToClientStatus(GroupBuyPostStatus postStatus) {
return isCompleted(postStatus) ? "COMPLETED" : "IN_PROGRESS";
}
}