[FIX] 버그 수정 - #716
Conversation
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthrough사용자 정보 수정 시 Changes사용자 프로필 수정
결제 환불 및 멤버십 갱신
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PaymentCommandService
participant CancelPolicy
participant PaymentRepository
participant PaymentStatusUpdater
participant SetUserMembershipPort
PaymentCommandService->>PaymentRepository: 미환불 성공 결제 조회
PaymentCommandService->>CancelPolicy: 환불 대상 및 결과 플랜 계산
PaymentCommandService->>PaymentStatusUpdater: 환불 또는 취소 실패 저장
PaymentCommandService->>PaymentStatusUpdater: 멤버십 독립 갱신 요청
PaymentStatusUpdater->>SetUserMembershipPort: 멤버십 업데이트
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
legend-momo-city/src/main/java/com/wanted/momocity/payment/application/policy/CancelPolicy.java (1)
48-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win환불 가능 기간 판정 로직 중복.
isWithinRefundPeriod의payment.getCreatedAt().plusDays(REFUNDABLE_DAYS).isAfter(LocalDateTime.now())는checkRefundable(Line 31-32)의 동일 식과 중복됩니다. 향후 환불 기간 계산 로직 변경 시 두 곳을 모두 수정해야 하는 부담이 있습니다.♻️ 공통 헬퍼로 추출 제안
+ private boolean isRefundPeriodValid(Payment payment) { + return payment.getCreatedAt().plusDays(REFUNDABLE_DAYS).isAfter(LocalDateTime.now()); + } + public void checkRefundable(Payment payment) { - boolean withinPeriod = payment.getStatus() == Status.SUCCESS - && payment.getCreatedAt().plusDays(REFUNDABLE_DAYS).isAfter(LocalDateTime.now()); + boolean withinPeriod = payment.getStatus() == Status.SUCCESS + && isRefundPeriodValid(payment); ... } public boolean isWithinRefundPeriod(Payment payment) { - return payment.getCreatedAt().plusDays(REFUNDABLE_DAYS).isAfter(LocalDateTime.now()); + return isRefundPeriodValid(payment); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@legend-momo-city/src/main/java/com/wanted/momocity/payment/application/policy/CancelPolicy.java` around lines 48 - 51, Extract the shared refund-period calculation from checkRefundable and isWithinRefundPeriod into a single private helper in CancelPolicy, then have both methods reuse it. Preserve the current comparison behavior and refund eligibility semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@legend-momo-city/src/main/java/com/wanted/momocity/payment/application/policy/CancelPolicy.java`:
- Around line 53-71: Update resolveResultPlan so a PRO-only refund returns BASIC
rather than PLUS when no succeeded payment has Plan.PLUS; only return PLUS when
plusRefunded is true and the existing PRO refund condition is met, while
preserving the current BASIC outcomes.
---
Nitpick comments:
In
`@legend-momo-city/src/main/java/com/wanted/momocity/payment/application/policy/CancelPolicy.java`:
- Around line 48-51: Extract the shared refund-period calculation from
checkRefundable and isWithinRefundPeriod into a single private helper in
CancelPolicy, then have both methods reuse it. Preserve the current comparison
behavior and refund eligibility semantics.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a03944e1-cc1b-42f7-bace-7322c1939d2b
📒 Files selected for processing (7)
legend-momo-city/src/main/java/com/wanted/momocity/payment/application/policy/CancelPolicy.javalegend-momo-city/src/main/java/com/wanted/momocity/payment/application/policy/PaymentPolicy.javalegend-momo-city/src/main/java/com/wanted/momocity/payment/application/service/PaymentCommandService.javalegend-momo-city/src/main/java/com/wanted/momocity/payment/application/supporter/PaymentStatusUpdater.javalegend-momo-city/src/main/java/com/wanted/momocity/payment/domain/repository/PaymentRepository.javalegend-momo-city/src/main/java/com/wanted/momocity/payment/infrastructure/persistence/PaymentRepositoryAdapter.javalegend-momo-city/src/main/java/com/wanted/momocity/payment/infrastructure/persistence/SpringDataPaymentRepository.java
|
@CodeRabbitai full review |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 44 minutes. |
Summary by CodeRabbit