-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 경매장 거래 내역 통계 조회 API 구현 #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ 테스트 결과 for PRBuild: success 🧪 테스트 실행 with Gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements API endpoints to retrieve auction history statistics with filtering capabilities. The changes transform the statistics controllers from generic pagination-based list endpoints to specialized search APIs that filter data by categories and date ranges.
Changes:
- Introduced utility classes for date range validation and week conversion
- Added search request DTOs for all statistics endpoints (daily and weekly, across item/subcategory/top-category levels)
- Updated repository interfaces with new query methods for filtered data retrieval
- Refactored service and controller layers to support search by category and date range instead of generic pagination
- Added category fields to ItemDailyStatistics and ItemWeeklyStatistics entities
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| WeekConverter.java | Utility for converting date ranges to ISO 8601 year-week lists |
| DateRangeValidator.java | Validates date ranges for daily (30 days) and weekly (120 days) queries |
| *Repository.java (6 files) | Added query methods for filtering by category and date range |
| *SearchRequest.java (6 files) | New DTOs for search requests with category and date parameters |
| *Controller.java (6 files) | Replaced pagination endpoints with category-based search endpoints |
| ItemWeeklyStatistics.java | Added itemTopCategory and itemSubCategory fields |
| ItemDailyStatistics.java | Added itemTopCategory and itemSubCategory fields |
| *Service.java (6 files) | Replaced findAll/findById methods with search methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import org.springframework.data.repository.query.Param; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
| import until.the.eternity.statistics.domain.entity.weekly.TopCategoryWeeklyStatistics; | ||
| import until.the.eternity.statistics.util.WeekConverter; |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WeekConverter import is unused in this file. Consider removing it to keep imports clean.
| import until.the.eternity.statistics.util.WeekConverter; |
| import org.springframework.data.repository.query.Param; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
| import until.the.eternity.statistics.domain.entity.weekly.SubcategoryWeeklyStatistics; | ||
| import until.the.eternity.statistics.util.WeekConverter; |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WeekConverter import is unused in this file. Consider removing it to keep imports clean.
| import until.the.eternity.statistics.util.WeekConverter; |
| import org.springframework.data.repository.query.Param; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
| import until.the.eternity.statistics.domain.entity.weekly.ItemWeeklyStatistics; | ||
| import until.the.eternity.statistics.util.WeekConverter; |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WeekConverter import is unused in this file. Consider removing it to keep imports clean.
| import until.the.eternity.statistics.util.WeekConverter; |
| public ResponseEntity<java.util.List<TopCategoryWeeklyStatisticsResponse>> | ||
| searchTopCategoryWeeklyStatistics( | ||
| @ParameterObject @ModelAttribute | ||
| @jakarta.validation.Valid | ||
| until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryWeeklyStatisticsSearchRequest |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses fully qualified class names (java.util.List, jakarta.validation.Valid, until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryWeeklyStatisticsSearchRequest) instead of importing them. Add proper imports and use simple class names for better readability.
| public ResponseEntity<java.util.List<TopCategoryDailyStatisticsResponse>> | ||
| searchTopCategoryDailyStatistics( | ||
| @ParameterObject @ModelAttribute | ||
| @jakarta.validation.Valid | ||
| until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryDailyStatisticsSearchRequest |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses fully qualified class names (java.util.List, jakarta.validation.Valid, until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryDailyStatisticsSearchRequest) instead of importing them. Add proper imports and use simple class names for better readability.
| Page<TopCategoryDailyStatisticsResponse> dtoPage = page.map(mapper::toDto); | ||
| return PageResponseDto.of(dtoPage); | ||
| } | ||
| public java.util.List<TopCategoryDailyStatisticsResponse> search( |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.
| Page<SubcategoryWeeklyStatisticsResponse> dtoPage = page.map(mapper::toDto); | ||
| return PageResponseDto.of(dtoPage); | ||
| } | ||
| public java.util.List<SubcategoryWeeklyStatisticsResponse> search( |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.
| Page<SubcategoryDailyStatisticsResponse> dtoPage = page.map(mapper::toDto); | ||
| return PageResponseDto.of(dtoPage); | ||
| } | ||
| public java.util.List<SubcategoryDailyStatisticsResponse> search( |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.
| Page<ItemWeeklyStatisticsResponse> dtoPage = page.map(mapper::toDto); | ||
| return PageResponseDto.of(dtoPage); | ||
| } | ||
| public java.util.List<ItemWeeklyStatisticsResponse> search( |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.
| Page<ItemDailyStatisticsResponse> dtoPage = page.map(mapper::toDto); | ||
| return PageResponseDto.of(dtoPage); | ||
| } | ||
| public java.util.List<ItemDailyStatisticsResponse> search( |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new search method lacks test coverage. The existing tests only cover findAll and findById which have been removed. Add tests for the search method including validation and query scenarios.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📋 상세 설명
통계 API를 페이지네이션 기반 조회 → 조건 기반 검색 API로 전환
통계 조회를 위한 Search Request DTO 및 날짜 유틸 도입
*날짜 검증 및 변환 로직을 컨트롤러/서비스에서 제거하고 공통 유틸로 분리함으로써, 중복 코드를 제거하고 날짜 계산 기준(주 시작일, 종료일 등)을 일관되게 유지할 수 있도록 개선
통계 엔티티 및 조회 계층에 카테고리 필드 기반 구조 확장
📊 체크리스트
📆 마감일