From 3d7afbe27ea6989688e2270c7f80b2f77ed5151e Mon Sep 17 00:00:00 2001 From: 88guri Date: Fri, 23 Jan 2026 20:38:22 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20#199=20=EA=B5=AC=EB=A7=A4?= =?UTF-8?q?=EC=9E=90=20-=20=EC=B0=B8=EC=97=AC=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=AA=A8=EC=A7=91=EC=99=84=EB=A3=8C=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EB=B6=84=EC=B2=A0=EA=B8=80=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EB=A5=BC=20=EB=94=B0=EB=A5=B4=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ParticipationService.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java b/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java index adbcaf9..fdacf95 100644 --- a/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java +++ b/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java @@ -63,8 +63,7 @@ public LeaderUserIdResponse confirmDelivered(Long userId, Long participationId) // OrderStatus기준 배송중(SHIPPED)일 때만 배송완료 확정 가능 if (order.getStatus() != OrderStatus.SHIPPED) { - throw new BusinessException( - ErrorStatus.ORDER_NOT_SHIPPED); + throw new BusinessException(ErrorStatus.ORDER_NOT_SHIPPED); } // 1 내 주문 배송완료 처리 (OrderStatus) @@ -88,7 +87,6 @@ public LeaderUserIdResponse confirmDelivered(Long userId, Long participationId) return new LeaderUserIdResponse(leaderUserId); } - // OrderStatus가 DELIVERED면 COMPLETED로 봄 private boolean isCompleted(OrderStatus status) { return status == OrderStatus.DELIVERED; @@ -105,21 +103,25 @@ private boolean matchParticipationStatus(Order order, ParticipationStatus status } // OrderStatus를 GroupBuyPostStatus처럼 내려줌 - private String mapToClientPostStatus(OrderStatus orderStatus) { - return switch (orderStatus) { - case RECRUITING -> GroupBuyPostStatus.RECRUITING.name(); + // GroupBuyPostStatus 우선 반영(RECRUITING까지) -> CLOSED 이후에는 OrderStatus 기준 + private String mapToClientPostStatus(GroupBuyPostStatus postStatus, OrderStatus orderStatus) { - case WAIT_PAY, WAIT_PAY_CHECK -> GroupBuyPostStatus.CLOSED.name(); + // 1 분철글이 모집중이면 무조건 RECRUITING 고정 + if (postStatus == GroupBuyPostStatus.RECRUITING) { + return GroupBuyPostStatus.RECRUITING.name(); + } + return switch (orderStatus) { + 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(); + + // (방어) 데이터가 꼬여서 RECRUITING이 내려오면 RECRUITING 그대로 반환 + case RECRUITING -> GroupBuyPostStatus.RECRUITING.name(); }; } - // 응답 Status를 OrderStatus로 내려줌 private ParticipationListResponse toResponse(Order order) { var post = order.getGroupBuyPost(); @@ -130,7 +132,7 @@ private ParticipationListResponse toResponse(Order order) { post.getArtist().getName(), post.getTitle(), post.getRepresentativeImageUrl(), - mapToClientPostStatus(order.getStatus()) + mapToClientPostStatus(post.getStatus(), order.getStatus()) ); } } \ No newline at end of file From 20452796211a32d0f8fda460cecd47c2e91c7ca7 Mon Sep 17 00:00:00 2001 From: 88guri Date: Fri, 23 Jan 2026 20:39:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20#199=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/participation/service/ParticipationService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java b/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java index fdacf95..8df7664 100644 --- a/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java +++ b/src/main/java/org/sopt/poti/domain/participation/service/ParticipationService.java @@ -74,7 +74,7 @@ public LeaderUserIdResponse confirmDelivered(Long userId, Long participationId) Long leaderUserId = order.getGroupBuyPost().getLeader().getId(); long remaining = orderService.countByGroupBuyPostIdAndStatusNot(postId, OrderStatus.DELIVERED); - // 3) 남은 주문이 0개 -> GroupBuyPostStatus도 배송완료로 변경 + // 3 남은 주문이 0개 -> GroupBuyPostStatus도 배송완료로 변경 if (remaining == 0) { GroupBuyPost post = order.getGroupBuyPost(); @@ -117,7 +117,7 @@ private String mapToClientPostStatus(GroupBuyPostStatus postStatus, OrderStatus case SHIPPED -> GroupBuyPostStatus.SHIPPING.name(); case DELIVERED -> GroupBuyPostStatus.DELIVERED.name(); - // (방어) 데이터가 꼬여서 RECRUITING이 내려오면 RECRUITING 그대로 반환 + // 데이터가 꼬여 RECRUITING이 내려오는 경우, RECRUITING 그대로 반환 case RECRUITING -> GroupBuyPostStatus.RECRUITING.name(); }; }