Skip to content

fix: 영업시간 없는 주문 가능 상점의 영업 상태를 종료로 처리 - #2577

Open
dnjswldnd-3513 wants to merge 1 commit into
developfrom
fix/2576-orderable-shop-missing-schedule
Open

dnjswldnd-3513 wants to merge 1 commit into
developfrom
fix/2576-orderable-shop-missing-schedule

Conversation

@dnjswldnd-3513

@dnjswldnd-3513 dnjswldnd-3513 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

🔍 개요

주문 가능 상점 중 오늘 요일의 영업시간(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.

@dnjswldnd-3513 dnjswldnd-3513 self-assigned this Dec 3, 2026
@github-actions github-actions Bot added the 버그 정상적으로 동작하지 않는 문제상황입니다. label Dec 3, 2026
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: 버그

Suggested reviewers: insik03, taejinn

Merge Risk: Minimal · up to adbd1

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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed [#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 Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af301441-3598-4ee5-a210-31536a9753f5
Commits

Reviewing files that changed from the base of the PR and between d29f4bc and adbd1c3.

Files selected for processing: 2

  • src/main/java/in/koreatech/koin/domain/order/shop/service/OrderableShopOpenStatusEvaluator.java
  • src/test/java/in/koreatech/koin/unit/domain/order/OrderableShopOpenStatusEvaluatorTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Unit Test Results

   366 files     366 suites   7m 57s ⏱️
2 133 tests 2 130 ✔️ 3 💤 0 ❌
2 187 runs  2 184 ✔️ 3 💤 0 ❌

Results for commit adbd1c3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제상황입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[버그] 영업시간이 없는 주문 가능 상점이 있으면 주문 상점 목록 조회 실패

1 participant