You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
주문 가능 상점 중 오늘 요일의 영업시간(shop_opens)이 없는 상점이 있으면, 영업 상태 계산에서 NullPointerException이 나 GET /order/shops 전체가 500으로 응답했습니다. 12-04 stage에서 영업시간이 하나도 없는 테스트용 주문 가능 상점 때문에 발생했습니다.
영업 중 설정이 꺼져 있고 오늘 영업시간이 없는 상점은 CLOSED로 처리해, 상점 하나 때문에 목록 전체가 실패하지 않도록 했습니다.
OrderableShopOpenStatusEvaluator: 오늘 요일의 영업 정보가 없으면 CLOSED를 반환합니다. 영업 중으로 설정한 상점은 기존처럼 OPERATING입니다.
OrderableShopOpenStatusEvaluatorTest: 영업 정보가 없는 상점의 상태와, 영업 정보가 없는 상점이 섞인 목록의 상태 계산 테스트를 추가했습니다.
💬 참고 사항
같은 계산을 쓰는 주문 가능 상점 검색(OrderableShopSearchUseCase)에도 함께 적용됩니다.
상점 생성 API는 영업시간 7개를 필수로 받지만, 주문 서비스 전환(OrderableShopPromotionService)은 영업시간이 있는지 확인하지 않습니다. 전환 시 검증 추가는 이번 PR에 넣지 않았습니다.
stage의 테스트 상점 데이터는 수정하지 않았습니다.
✅ Checklist
코드 스타일 가이드 준수
테스트 코드 포함됨
Reviewers / Assignees / Labels 지정 완료
보안 및 민감 정보 검증
Summary by CodeRabbit
Bug Fixes
Shops not marked as open that have no schedule for the current day now appear as Closed in shop listings and status views. Shops marked open continue to appear as Operating, while shops with a schedule continue to show their applicable Preparing or Closed status. This helps clarify shop availability for the current day.
No actionable comments were generated in the recent review.
Walkthrough
The shop status evaluator now returns CLOSED when a shop is not marked open and has no schedule row for today. Tests cover this case and confirm that a shop marked open remains OPERATING.
Changes: Shop Open Status
Layer / File(s)
Summary
Handle missing schedules and verify shop statuses src/main/java/in/koreatech/koin/domain/order/shop/service/OrderableShopOpenStatusEvaluator.java, src/test/java/in/koreatech/koin/unit/domain/order/OrderableShopOpenStatusEvaluatorTest.java
The evaluator returns CLOSED when a shop is not marked open and has no schedule row for today. Tests verify this result and confirm that a shop marked open remains OPERATING.
The change stops GET /order/shops from failing with a 500 when a shop has no opening hours for today. Such shops now show as closed, and shops marked open keep their status. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title is in Korean and reads roughly 'fix: set the open status of orderable shops without opening hours to closed'. It matches the main change: the evaluator now returns CLOSED when a shop is not …
Linked Issues check
[#2576] The issue requires three behaviors. (1) A shop that is not set to operating and has no opening-hours row for today must return CLOSED. (2) A shop set to operating must keep returning OPERATING…
Out of Scope Changes check
The PR changes two files: OrderableShopOpenStatusEvaluator.java (a null-schedule guard and a Javadoc update) and OrderableShopOpenStatusEvaluatorTest.java (two tests and a helper). Each change directl…
Full details: Title check
Explanation
The title is in Korean and reads roughly 'fix: set the open status of orderable shops without opening hours to closed'. It matches the main change: the evaluator now returns CLOSED when a shop is not marked open and has no schedule row for today, which fixes the NullPointerException in GET /order/shops. The title is specific and describes the primary change, and it does not cover the test additions, which is acceptable.
Full details: Linked Issues check
Explanation
[#2576] The issue requires three behaviors. (1) A shop that is not set to operating and has no opening-hours row for today must return CLOSED. (2) A shop set to operating must keep returning OPERATING. (3) A test must show that a shop without hours does not break status calculation for other shops in the same list.
At the reviewed head, OrderableShopOpenStatusEvaluator.determineOpenStatus checks shopIsOpen first and returns OPERATING when it is true. It then returns CLOSED when shopOpenInfo is null, which covers the missing-today-row case. This removes the NullPointerException path described in the issue. The Javadoc is updated to include the missing-schedule case.
OrderableShopOpenStatusEvaluatorTest adds determineOpenStatus_NoScheduleTodayNotOpenClosed, which checks CLOSED for a null schedule with shopIsOpen=false. It also adds findOpenStatusByShopBasicInfos_ShopWithoutScheduleClosed, which uses a mixed list in which shop 1 has no schedule and shop 2 is open. The test asserts CLOSED for shop 1 and OPERATING for shop 2. Together these cover the three requirements.
OrderableShopSearchUseCase uses the same evaluator, so the search path receives the same fix without a separate change. I did not inspect the search use case directly. The coverage for that path is inferred from the shared calculation.
The issue's non-coding exclusions (stage data, order-service promotion validation) are not coding requirements for this PR.
Full details: Out of Scope Changes check
Explanation
The PR changes two files: OrderableShopOpenStatusEvaluator.java (a null-schedule guard and a Javadoc update) and OrderableShopOpenStatusEvaluatorTest.java (two tests and a helper). Each change directly implements the issue's requirement or verifies it. The PR does not modify stage test-shop data or OrderableShopPromotionService, which the issue and PR description both exclude. No unrelated changes were found in the files examined.
Limit: the diff tool could not read the changed blobs, and the base revision blob for the evaluator was not readable. The head file content and the test file content were read directly. The file list in the whole-PR summary was used to confirm the set of changed files.
Finishing Touches
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 개요
주문 가능 상점 중 오늘 요일의 영업시간(
shop_opens)이 없는 상점이 있으면, 영업 상태 계산에서NullPointerException이 나GET /order/shops전체가 500으로 응답했습니다. 12-04 stage에서 영업시간이 하나도 없는 테스트용 주문 가능 상점 때문에 발생했습니다.영업 중 설정이 꺼져 있고 오늘 영업시간이 없는 상점은
CLOSED로 처리해, 상점 하나 때문에 목록 전체가 실패하지 않도록 했습니다.🚀 주요 변경 내용
OrderableShopOpenStatusEvaluator: 오늘 요일의 영업 정보가 없으면CLOSED를 반환합니다. 영업 중으로 설정한 상점은 기존처럼OPERATING입니다.OrderableShopOpenStatusEvaluatorTest: 영업 정보가 없는 상점의 상태와, 영업 정보가 없는 상점이 섞인 목록의 상태 계산 테스트를 추가했습니다.💬 참고 사항
OrderableShopSearchUseCase)에도 함께 적용됩니다.OrderableShopPromotionService)은 영업시간이 있는지 확인하지 않습니다. 전환 시 검증 추가는 이번 PR에 넣지 않았습니다.✅ Checklist
Summary by CodeRabbit