Skip to content

fix: 어드민 등하교 버스 시간표에 running_days 저장 - #2399

Merged
insik03 merged 1 commit into
developfrom
fix/2398-admin-commuting-bus-running-days
Sep 1, 2026
Merged

fix: 어드민 등하교 버스 시간표에 running_days 저장#2399
insik03 merged 1 commit into
developfrom
fix/2398-admin-commuting-bus-running-days

Conversation

@insik03

@insik03 insik03 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🔍 개요


🚀 주요 변경 내용

  • AdminCommutingBusServiceRunningDays.WEEKDAYStoRouteInfoEntity() 로 넘겨 신규·기존 시간표 모두 running_days 를 채웁니다.
  • AdminCommutingBusUpdateRequest.InnerRouteInfo.toEntity()runningDays 파라미터 추가.
  • 단위 테스트 2건 추가 (신규 생성 시 주중 저장 / 기존 문서 갱신 시 주중 백필).

💬 참고 사항

  • 클라이언트 변경이 필요 없습니다. [공통] 어드민 셔틀버스 시간표 API에 running_days 필드 누락 #2396(셔틀)과 달리 요청 필드를 추가하지 않고 서버가 값을 도출합니다.
    • AdminCommutingBusServicerouteType.validateCommuting() 으로 SHUTTLE·WEEKEND 를 거부하므로 주중 노선만 통과합니다. 운행 요일이 MON~FRI 로 결정돼 있습니다.
    • 통학 엑셀 추출기는 셔틀과 달리 운행 요일을 계산하지 않아, 클라이언트가 왕복시킬 값 자체가 없습니다.
  • 기존 데이터가 자동 복구됩니다. 이미 running_days 가 null 인 등하교 문서는 다음 시간표 업데이트 때 채워집니다. (셔틀은 회차별 요일이 달라 자가 복구가 불가능하며 엑셀 재업로드가 필요합니다)
  • RunningDaysadmin.bus.shuttle.enums 에 있어 commuting 패키지에서 참조합니다. 같은 admin.bus 하위라 그대로 재사용했습니다.

✅ Checklist (완료 조건)

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

Summary by CodeRabbit

  • Bug Fixes

    • Commuting shuttle bus timetables now correctly record weekday operation (Monday–Friday).
    • Existing timetables with missing operating days are automatically updated with weekday information while preserving arrival times.
  • Tests

    • Added coverage for creating and updating commuting bus timetables, including operating-day data.

등하교 시간표도 셔틀과 같은 shuttlebus_timetables 컬렉션에 저장되지만
running_days 를 채우지 않아, 요일 필터에 걸리지 않아 교통편 조회에서
누락되었다.

셔틀과 달리 통학 엑셀 추출기는 운행 요일을 계산하지 않고,
validateCommuting() 으로 주중 노선만 허용되므로 클라이언트에 필드를
요구하는 대신 서버가 routeType 으로부터 주중을 채우도록 한다.
이로써 기존에 running_days 가 비어 있던 등하교 문서도 다음 갱신 때
자동으로 복구된다.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 01:38
@github-actions github-actions Bot added 공통 백엔드 공통으로 작업할 이슈입니다. 버그 정상적으로 동작하지 않는 문제상황입니다. labels Sep 1, 2026
@github-actions
github-actions Bot requested review from DHkimgit and ImTotem September 1, 2026 01:38
@insik03
insik03 requested review from dnjswldnd-3513 and taejinn and removed request for DHkimgit and ImTotem September 1, 2026 01:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a data integrity issue where commuting (등하교) bus timetable route entries were being saved without running_days, causing day-of-week filtering to exclude them from route queries. It aligns commuting timetable persistence with the already-fixed shuttle behavior, but derives weekdays server-side (since commuting routes are validated to be weekdays-only).

Changes:

  • Populate route_info.running_days for commuting timetables by passing RunningDays.WEEKDAYS.getDays() into route-info entity creation for both create and update paths.
  • Extend AdminCommutingBusUpdateRequest.InnerRouteInfo.toEntity() / toRouteInfoEntity() to accept and persist runningDays.
  • Add unit tests covering weekdays persistence on 신규 생성 and weekdays backfill on 기존 문서 갱신.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/main/java/in/koreatech/koin/admin/bus/commuting/service/AdminCommutingBusService.java Derives weekdays running days after validateCommuting() and ensures it’s persisted on create/update.
src/main/java/in/koreatech/koin/admin/bus/commuting/dto/AdminCommutingBusUpdateRequest.java Updates route-info entity mapping to include runningDays so persistence includes the field.
src/test/java/in/koreatech/koin/unit/admin/bus/AdminCommutingBusServiceTest.java Adds tests for weekdays saved on create and backfilled on update.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dnjswldnd-3513 dnjswldnd-3513 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

확인했습니당

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 670df26b-1ea4-40e1-8f50-17da54f80c62

📥 Commits

Reviewing files that changed from the base of the PR and between 233cbf7 and 1b2dc03.

📒 Files selected for processing (3)
  • src/main/java/in/koreatech/koin/admin/bus/commuting/dto/AdminCommutingBusUpdateRequest.java
  • src/main/java/in/koreatech/koin/admin/bus/commuting/service/AdminCommutingBusService.java
  • src/test/java/in/koreatech/koin/unit/admin/bus/AdminCommutingBusServiceTest.java

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


📝 Walkthrough

Walkthrough

Admin commuting bus timetable routes now receive weekday running days during entity conversion. The service applies these days on create and update operations. Unit tests cover new timetable creation and backfilling existing routes.

Changes

Commuting timetable running days

Layer / File(s) Summary
Route running-days mapping
src/main/java/in/koreatech/koin/admin/bus/commuting/dto/AdminCommutingBusUpdateRequest.java
toRouteInfoEntity and toEntity now accept runningDays and store them in ShuttleBusRoute.RouteInfo.
Weekday assignment and validation
src/main/java/in/koreatech/koin/admin/bus/commuting/service/AdminCommutingBusService.java, src/test/java/in/koreatech/koin/unit/admin/bus/AdminCommutingBusServiceTest.java
The service passes RunningDays.WEEKDAYS on create and update paths. Tests verify weekday persistence and backfilling while preserving updated arrival times.

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

Merge Risk: 🔵 Low · up to 1b2dc

The change correctly stores weekdays for new and matching timetable entries, but older records with differing nested route names may remain unrepaired and continue to be omitted by weekday filtering. The PR is mergeable with owner awareness that automatic backfill is conditional.

Suggested reviewers: taejinn

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: storing running_days for admin commuting bus timetables.
Linked Issues check ✅ Passed The changes set MON–FRI running_days for new and updated commuting timetables, restore missing values, avoid client changes, and add the required unit tests for issue #2398.
Out of Scope Changes check ✅ Passed The DTO, service, and unit test changes directly support issue #2398. No unrelated shuttle-day logic, new-trip handling, or public API response changes are included.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2398-admin-commuting-bus-running-days

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

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Unit Test Results

1 054 tests   1 051 ✔️  2m 16s ⏱️
   244 suites         3 💤
   244 files           0

Results for commit 1b2dc03.

@insik03
insik03 merged commit 2bbb2a2 into develop Sep 1, 2026
8 of 9 checks passed
@insik03
insik03 deleted the fix/2398-admin-commuting-bus-running-days branch September 1, 2026 01:46
@taejinn taejinn mentioned this pull request Sep 1, 2026
4 tasks
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.

[공통] 어드민 등하교 버스 시간표에 running_days 가 저장되지 않음

4 participants