fix: 어드민 등하교 버스 시간표에 running_days 저장 - #2399
Conversation
등하교 시간표도 셔틀과 같은 shuttlebus_timetables 컬렉션에 저장되지만 running_days 를 채우지 않아, 요일 필터에 걸리지 않아 교통편 조회에서 누락되었다. 셔틀과 달리 통학 엑셀 추출기는 운행 요일을 계산하지 않고, validateCommuting() 으로 주중 노선만 허용되므로 클라이언트에 필드를 요구하는 대신 서버가 routeType 으로부터 주중을 채우도록 한다. 이로써 기존에 running_days 가 비어 있던 등하교 문서도 다음 갱신 때 자동으로 복구된다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
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_daysfor commuting timetables by passingRunningDays.WEEKDAYS.getDays()into route-info entity creation for both create and update paths. - Extend
AdminCommutingBusUpdateRequest.InnerRouteInfo.toEntity()/toRouteInfoEntity()to accept and persistrunningDays. - 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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdmin 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. ChangesCommuting timetable running days
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to 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: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
🔍 개요
running_days)이 채워지지 않아, 요일 필터에 걸리지 않아 교통편 조회에서 누락되던 문제를 수정합니다.🚀 주요 변경 내용
AdminCommutingBusService가RunningDays.WEEKDAYS를toRouteInfoEntity()로 넘겨 신규·기존 시간표 모두running_days를 채웁니다.AdminCommutingBusUpdateRequest.InnerRouteInfo.toEntity()에runningDays파라미터 추가.💬 참고 사항
AdminCommutingBusService가routeType.validateCommuting()으로SHUTTLE·WEEKEND를 거부하므로 주중 노선만 통과합니다. 운행 요일이MON~FRI로 결정돼 있습니다.running_days가 null 인 등하교 문서는 다음 시간표 업데이트 때 채워집니다. (셔틀은 회차별 요일이 달라 자가 복구가 불가능하며 엑셀 재업로드가 필요합니다)RunningDays는admin.bus.shuttle.enums에 있어 commuting 패키지에서 참조합니다. 같은admin.bus하위라 그대로 재사용했습니다.✅ Checklist (완료 조건)
Summary by CodeRabbit
Bug Fixes
Tests