💫 [feature] #114 - 미수령 보상 탭 및 보상 집계 구조 추가 - #116
Conversation
GET/POST /api/v1/rewards로 일반 미션 미수령 조회·개별·일괄 수령을 제공한다.
|
Warning Review limit reached
Next review available in: 29 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdded reward-tab response models, mission-completion queries for unclaimed rewards, services for individual and bulk claiming, reward HTTP endpoints, and tests covering service mapping and controller behavior. ChangesReward management
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant RewardController
participant RewardQueryService
participant MissionCompletionRepository
participant RewardClaimService
participant MissionRewardClaimService
Client->>RewardController: GET /api/v1/rewards
RewardController->>RewardQueryService: getRewards(userId)
RewardQueryService->>MissionCompletionRepository: find approved unclaimed completions
MissionCompletionRepository-->>RewardQueryService: mission completions
RewardQueryService-->>RewardController: RewardsTabResponse
RewardController-->>Client: ApiResponse
Client->>RewardController: POST /api/v1/rewards/{rewardId}/claim
RewardController->>RewardClaimService: claimReward(userId, rewardId)
RewardClaimService->>MissionRewardClaimService: claim mission reward
MissionRewardClaimService-->>RewardClaimService: claim result or error
RewardClaimService-->>RewardController: ClaimRewardResponse
RewardController-->>Client: ApiResponse
Client->>RewardController: POST /api/v1/rewards/claim-all
RewardController->>RewardClaimService: claimAll(userId)
RewardClaimService->>RewardQueryService: listClaimableMissionCompletions(userId)
RewardQueryService-->>RewardClaimService: claimable completions
RewardClaimService->>MissionRewardClaimService: claim each reward
RewardClaimService-->>RewardController: ClaimAllRewardsResponse
RewardController-->>Client: ApiResponse
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/main/kotlin/com/zerost/api/reward/application/RewardQueryService.kt`:
- Around line 56-59: The MISSION reward bundle currently duplicates the
completion ID in sourceId; update RewardQueryService to use
completion.mission.id for sourceId while keeping rewardId mapped to
completion.id. In
src/main/kotlin/com/zerost/api/reward/application/RewardQueryService.kt lines
56-59, make this mapping change; in
src/test/kotlin/com/zerost/api/reward/application/RewardQueryServiceTest.kt
lines 52-57, assert sourceId equals 1L alongside rewardId equals 55L.
- Around line 43-50: Validate that the user exists before returning bulk-claim
candidates from listClaimableMissionCompletions, or add the same validation at
the start of claimAll. Reuse the existing user-validation mechanism used by
getRewards so unknown users produce the documented 404 instead of an empty
successful response.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 40f07dc7-c72d-412b-a917-ba19619969f6
📒 Files selected for processing (8)
src/main/kotlin/com/zerost/api/common/exception/ErrorCode.ktsrc/main/kotlin/com/zerost/api/mission/domain/MissionCompletionRepository.ktsrc/main/kotlin/com/zerost/api/reward/application/RewardClaimService.ktsrc/main/kotlin/com/zerost/api/reward/application/RewardQueryService.ktsrc/main/kotlin/com/zerost/api/reward/presentation/RewardController.ktsrc/main/kotlin/com/zerost/api/reward/presentation/dto/RewardsResponses.ktsrc/test/kotlin/com/zerost/api/reward/application/RewardQueryServiceTest.ktsrc/test/kotlin/com/zerost/api/reward/presentation/RewardControllerTest.kt
CodeRabbit 리뷰 반영.
#️⃣ Issue Number
📝 요약(Summary)
GET /api/v1/rewards— summary + 미수령 items (Notion 명세)POST /api/v1/rewards/{rewardId}/claim— 개별 수령POST /api/v1/rewards/claim-all— 일괄 수령rewardId=mission_completions.id)POST /missions/completions/{id}/claim은 유지 (내부 로직 재사용)📝 리뷰 요청사항
💻 테스트 결과
com.zerost.api.reward.*테스트 통과Summary by CodeRabbit
New Features
Tests