Skip to content

fix: 천안역 → 학교 방향 시내버스 시간표 조회 오류 수정#2215

Open
kih1015 wants to merge 3 commits intodevelopfrom
fix/2214-city-bus-route
Open

fix: 천안역 → 학교 방향 시내버스 시간표 조회 오류 수정#2215
kih1015 wants to merge 3 commits intodevelopfrom
fix/2214-city-bus-route

Conversation

@kih1015
Copy link
Copy Markdown
Contributor

@kih1015 kih1015 commented Apr 8, 2026

🔍 개요

  • 시내버스 시간표 조회 시 출발지 조건 분기 로직이 잘못되어, 천안역 → 학교 방향 조회 시 잘못된 시간표가 반환되는 문제를 수정했습니다.

🚀 주요 변경 내용

  • CityBusRouteStrategy.getScheduleForRoute() 메서드의 조건 분기를 depart == TERMINALdepart == KOREATECH 로 변경
    • 기존: 출발지가 터미널일 때 "종합터미널" 기점 시간표 조회 (나머지는 cityBusInfo.getName())
    • 변경: 출발지가 코리아텍일 때 cityBusInfo.getName() 기점 시간표 조회 (나머지는 "종합터미널")
    • 결과: 천안역(STATION) 출발 시 올바르게 "종합터미널" 기점 시간표를 참조하도록 수정
  • CityBusRouteStrategyTest 단위 테스트 추가
    • 학교 방면: 터미널→천안역, 터미널→코리아텍, 천안역→코리아텍
    • 터미널 방면: 천안역→터미널(빈 목록), 코리아텍→터미널, 코리아텍→천안역

💬 참고 사항

  • 천안역 출발 시 +7분 보정, 코리아텍 출발 시 버스별 보정(400: +6분, 402: +13분, 405: +7분)이 기존 로직에 의해 정상 적용됩니다.
  • 조건 분기의 의미: 시내버스 노선의 기점이 "코리아텍 방면(병천3리/황사동/유관순열사사적지)"인 경우는 코리아텍 출발일 때만 해당되며, 나머지 출발지는 모두 "종합터미널" 기점 시간표를 사용합니다.

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • Bug Fixes

    • Fixed city bus schedule retrieval logic to ensure accurate timetable lookups based on departure station.
  • Tests

    • Added comprehensive test coverage for city bus route scenarios and departure time corrections across multiple stations.

@github-actions github-actions bot added the 버그 정상적으로 동작하지 않는 문제상황입니다. label Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4826d0ba-09fc-4116-bcb0-03bd99ea631c

📥 Commits

Reviewing files that changed from the base of the PR and between 674e3a0 and 2e1ed40.

📒 Files selected for processing (2)
  • src/main/java/in/koreatech/koin/domain/bus/service/model/route/CityBusRouteStrategy.java
  • src/test/java/in/koreatech/koin/unit/domain/bus/CityBusRouteStrategyTest.java

📝 Walkthrough

Walkthrough

Fixed a logical bug in city bus route timetable retrieval where routes originating from KOREATECH station were incorrectly returning terminal-direction schedules instead of school-direction schedules. The condition now properly checks departure point to select appropriate timetable direction.

Changes

Cohort / File(s) Summary
Route Strategy Logic Fix
src/main/java/in/koreatech/koin/domain/bus/service/model/route/CityBusRouteStrategy.java
Corrected getScheduleForRoute control flow to return school-direction timetable (keyed by cityBusInfo.getName()) when depart == BusStation.KOREATECH, and terminal-direction timetable ("종합터미널") for all other departure points, fixing the STATION→KOREATECH route bug.
Comprehensive Test Coverage
src/test/java/in/koreatech/koin/unit/domain/bus/CityBusRouteStrategyTest.java
Added full JUnit 5 test suite with Mockito mocks for CityBusTimetableRepository, covering six route scenarios across two nested test classes (SchoolDirectionTest, TerminalDirectionTest), verifying schedule retrieval with correct departure-time corrections for each bus number.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Team Campus

Suggested reviewers

  • Soundbar91
  • DHkimgit

Poem

🚌✨ A rabbit hops through the station queue,
Once routes were tangled, now they're true—
From KOREATECH the schedules flow,
Direction fixed, where buses go! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main fix: correcting city bus timetable lookup for the Cheonan Station → KOREATECH direction.
Linked Issues check ✅ Passed Code changes directly address issue #2214 by flipping the branching condition from checking depart == TERMINAL to depart == KOREATECH, ensuring correct timetable origin selection for all six route-direction combinations.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the city bus timetable lookup logic and adding comprehensive unit tests; no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2214-city-bus-route

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 and usage tips.

@kih1015 kih1015 self-assigned this Apr 8, 2026
@kih1015 kih1015 requested a review from DHkimgit April 8, 2026 09:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Unit Test Results

671 tests   662 ✔️  1m 19s ⏱️
166 suites      9 💤
166 files        0

Results for commit f00363a.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍

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.

[캠퍼스] 시내버스 천안역→코리아텍 시간표 조회 방향 오류

2 participants