Repository navigation
fix: 생협 학기 자동 전환 시 오늘이 포함되고 매장이 있는 학기를 선택하도록 수정 - #2436
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Date-valid semester lookup src/main/java/in/koreatech/koin/domain/coopshop/model/CoopSemester.java, src/main/java/in/koreatech/koin/domain/coopshop/repository/CoopSemesterRepository.java |
CoopSemester now checks inclusive date validity and whether it has shops. The repository returns semesters that contain the requested date, ordered by start date and ID descending. |
Semester update and validation src/main/java/in/koreatech/koin/domain/coopshop/service/CoopShopService.java, src/test/java/in/koreatech/koin/unit/domain/coopshop/service/CoopShopServiceTest.java, src/test/java/in/koreatech/koin/acceptance/domain/CoopShopApiTest.java, src/test/java/in/koreatech/koin/acceptance/fixture/CoopShopAcceptanceFixture.java |
The service retains an applied semester only when it is valid and has shops. Otherwise, it selects a valid semester with shops before changing applied flags. If none is available, it throws CustomException and leaves the applied semester unchanged. Tests cover selection, failure, and inclusive date bounds. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: choon0414
Merge Risk: 
Minimal · up to 456ce
-
Semester selection uses eligible shop data and preserves the current semester when no replacement exists. No merge-blocking issue was found.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue [
#2433] requires automatic selection of a semester valid today with coop-shop data and related tests.CoopSemesterRepository.findAllValidOnqueries inclusive date ranges.CoopShopService.findNextSemesterfilters these results byhasCoopShops, andupdateSemesterchanges the applied flags only after a replacement is found. The service keeps the current semester when it is valid and has shops. The added unit tests cover valid boundaries, empty current data, empty candidates, expired current data, and successful selection. The acceptance test covers a later semester without shops.
Full details: Out of Scope Changes check
-
Explanation
The reviewed changes stay within issue [
#2433]. Repository selection, semester domain methods, service transition ordering, exception handling, fixtures, unit tests, and the acceptance test directly support the requested automatic semester-selection behavior. No unrelated production behavior or unrelated feature is demonstrated.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Soundbar91
left a comment
There was a problem hiding this comment.
A
해당 PR은 #2434 PR과 연계되는 거 같은데 맞을까요??
|
@Soundbar91 |
🔍 개요
학기 자동 전환 스케줄러가 다음 학기를 고를 때
CoopSemesterRepository.getTopByOrderByToDateDesc()(전체 학기 중 to_date가 가장 늦은 학기 단 하나)를 사용해서, "오늘 날짜가 포함된 학기"가 아니라 "미래의 매장 데이터 없는 학기"가 잘못 선택되어 정작 지금 유효한 학기로 전환하지 못하는 설계 결함이 있었습니다.🚀 주요 변경 내용
CoopSemesterRepository:findAllValidOn(LocalDate)쿼리 추가 — 오늘 날짜가 포함되는 학기를 전부 조회 (기존getTopByOrderByToDateDesc/findTopByOrderByToDateDesc는 사용처가 없어져 제거)CoopSemester:isValidOn(LocalDate),hasCoopShops()도메인 메서드 추가CoopShopService: 날짜 유효 후보들 중 매장 데이터가 있는 첫 번째 학기를 선택하도록findNextSemester()재작성. 다음 학기를 먼저 찾은 뒤 현재 학기를 내리도록 순서를 바꿔, 전환 실패 시에도 현재 학기 상태가 중간에 훼손되지 않도록 함. 현재 학기가 날짜상 유효해도 매장 데이터가 비어있으면 그대로 방치하지 않고 다른 학기를 탐색하도록 보강CustomException.of(NOT_FOUND_COOP_SEMESTER, ...)로 교체💬 참고 사항
CoopShopService.java를 같이 건드려서, merge 순서에 따라 나머지 브랜치 rebase가 필요할 수 있습니다.✅ Checklist
Summary by CodeRabbit