Conversation
- Admin API: GET /api/v1/incentive/admin/total/{partnerUuid}
- Partner API: GET /api/v1/incentive/partner/total (본인 조회)
- 단위 테스트 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds two new API endpoints for retrieving the total accumulated incentives for partners. The admin endpoint allows administrators to query any partner's total incentive, while the partner endpoint allows partners to query their own total incentive. The implementation includes service layer methods, repository queries, and comprehensive unit tests.
Changes:
- Added
getTotalIncentiveByPartnerUuidmethod across repository, service, and QueryDSL layers - Added two new REST endpoints: admin endpoint for querying any partner, and partner endpoint for self-query
- Added unit tests for the new service method and mock repository implementation
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| GetIncentiveDataController.java | Added two new endpoints for querying partner total incentives (admin and partner) |
| PartnerTotalIncentiveResponse.java | New response DTO for total incentive data |
| GetIncentiveDataService.java | Added service method to retrieve total incentive by partner UUID |
| IncentiveQueryRepository.java | Added interface method for single partner total incentive query |
| IncentiveQueryRepositoryImpl.java | Implemented repository method delegating to QueryDSL layer |
| IncentiveQuerydslRepository.java | Implemented QueryDSL query to sum total incentives for a partner |
| GetIncentiveDataServiceUnitTest.java | Added comprehensive unit tests for the new service method |
| IncentiveJobManagementServiceUnitTest.java | Added mock implementation for testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public ResponseEntity<BaseResponse<PartnerTotalIncentiveResponse>> adminGetPartnerTotalIncentive( | ||
| @PathVariable UUID partnerUuid | ||
| ) { |
There was a problem hiding this comment.
The admin endpoint is missing the authentication parameter that is consistently used in similar endpoints throughout the codebase. All other admin endpoints for partner data queries include CustomUserDetails authentication parameter (e.g., GetTotalStatsController.java:50-51, GetRelationshipDataController.java:44, GetDailyStatsController.java:169-172). This parameter is typically used for audit logging or additional authorization checks. Consider adding @AuthenticationPrincipal CustomUserDetails authentication to maintain consistency with established patterns.
Issue ✨
변경점 👍