Skip to content

fix: 토요일/일요일 영업시간 조회 시 DayType 불일치로 조회 실패하는 문제 수정 - #2435

Open
dnjswldnd-3513 wants to merge 2 commits into
developfrom
fix/2431-coopshop-daytype-mismatch
Open

dnjswldnd-3513 wants to merge 2 commits into
developfrom
fix/2431-coopshop-daytype-mismatch

Conversation

@dnjswldnd-3513

@dnjswldnd-3513 dnjswldnd-3513 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🔍 개요

CoopShopService.getIsOpened()가 토요일/일요일을 무조건 DayType.WEEKEND로 판단해 운영시간을 조회했는데, 실제 운영 데이터는 학기 중엔 DayType.SATURDAY, 방학 중엔 DayType.WEEKEND로 저장되는 등 시점에 따라 달라져서 조회 실패(CoopOpenNotFoundException)가 발생하는 문제가 있었습니다. 실제로 production에서 토요일 운영시간이 SATURDAY로 저장돼있어 이 기능이 오작동할 수 있는 상태였습니다.


🚀 주요 변경 내용

  • CoopShopService: 토/일 조회 시 개별 요일(SATURDAY/SUNDAY)을 먼저 시도하고 없으면 WEEKEND로 대체 조회하는 findOpen()/candidateDayTypes() 추가
  • CoopOpenRepository: 교차검증 중 발견된, 더 이상 쓰이지 않는 getByCoopShopAndTypeAndDayOfWeek() 죽은 코드 제거
  • CoopShopServiceTest: 신규 유닛 테스트 5건 (평일/토요일 SATURDAY/토요일 WEEKEND 대체/일요일 WEEKEND 대체/둘 다 없으면 예외)

💬 참고 사항

  • 교차검증(Codex) 중 "평일도 개별 요일(MONDAY 등) 데이터가 있으면 fallback이 안 된다"는 지적이 있었으나, 실제 운영 데이터에서 개별 요일 값을 쓰는 사례가 없고 기존 동작과 동일해서 이번 PR 범위에서는 제외했습니다. 필요해지면 별도로 처리하겠습니다.

✅ Checklist

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증

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

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3d84d95a-02fe-446d-86ea-ae66c0bb2163

📥 Commits

Reviewing files that changed from the base of the PR and between c03ea01 and 5dd2506.

📒 Files selected for processing (3)
  • src/main/java/in/koreatech/koin/domain/coopshop/repository/CoopOpenRepository.java
  • src/main/java/in/koreatech/koin/domain/coopshop/service/CoopShopService.java
  • src/test/java/in/koreatech/koin/unit/domain/coopshop/CoopShopServiceTest.java

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Unit Test Results

   261 files  +1     261 suites  +1   2m 55s ⏱️ +12s
1 160 tests +5  1 157 ✔️ +5  3 💤 ±0  0 ❌ ±0 
1 168 runs  +5  1 165 ✔️ +5  3 💤 ±0  0 ❌ ±0 

Results for commit 5dd2506. ± Comparison against base commit c03ea01.

@Soundbar91 Soundbar91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A

토요일/일요일을 주말로 퉁 쳐버리는 문제가 있었군요.. 하드 코딩을 지우신 건 좋은 거 같아요. 다만, 토요일/일요일로 조회했을 때 없으면 주말로 조회해서 나온 데이터로 가는 건 조금 고민을 해봐야할 거 같아요.

토요일에만 운영하는 곳인데, 주말로 데이터가 잘못 올라가 있어서 주말로 데이터를 내려줄 수 있다는 생각이 들었습니다. 제가 이해한 내용이 틀릴 수도 있어서 관련해서 의견 남겨주시면 감사하겠습니다 !

@dnjswldnd-3513

Copy link
Copy Markdown
Contributor Author

@Soundbar91

의견 주셔서 감사합니다!
말씀하신 시나리오 정확히 이해했고, 실제로 코드 레벨에서 완전히 막기는 어려운 문제인 것 같습니다. WEEKEND 태그가 대부분의 매장에서 "토·일 동일"이란 의미로 정상적으로 쓰이고 있어서(학생식당 방학중, 편의점 등), fallback을 없애면 원래 버그(#2431)로 돌아갑니다.

코드보다는 데이터 입력/검토 단계의 문제라고 생각돼서, admin 업로드 시 미리보기 검토할 때 "토요일만 운영하는 곳이 주말로 잘못 태그되지 않았는지"를 체크리스트에 넣는 방향이 더 맞을 것 같습니다. 관련해서 의견 있으시면 말해주시면 감사하겠습니다!!

혹시 코드 레벨에서 더 나은 방법 있으면 알려주시면 감사하겠습니다!

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.

[버그] 토요일 학생식당 영업 여부 조회 시 DayType 불일치로 조회 실패

2 participants