Skip to content

fix(route): map small return gaps to Seoul - #13

Merged
ccjngwn merged 1 commit into
developfrom
feat/return-route-small-gap-seoul
Jul 10, 2026
Merged

fix(route): map small return gaps to Seoul#13
ccjngwn merged 1 commit into
developfrom
feat/return-route-small-gap-seoul

Conversation

@ccjngwn

@ccjngwn ccjngwn commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Treat return-route midpoint gaps of 15 minutes or less as Seoul(BASE) instead of querying city candidates.
  • Added a service test that verifies WEST 15 maps to Seoul and does not call the city candidate lookup.

Why

A return route such as 03:00~10:00 -> 23:00~07:00 can produce a tiny remaining gap right before arrival, for example WEST 15. The city mapping table does not cover that range, so route creation failed before saving.

Validation

  • ./gradlew test --tests com.cotato.cokerthon.domain.route.service.ReturnRouteServiceTest
  • ./gradlew test

Summary by CodeRabbit

  • Bug Fixes
    • Improved return-route selection near Seoul by falling back to Seoul when the route gap is 15 minutes or less.
    • Prevented unnecessary city searches in these short-gap scenarios, providing more consistent route results.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

ReturnRouteService now selects Seoul for base directions or gaps of 15 minutes or less. Tests cover the WEST 15-minute case by asserting the saved checkpoint city and confirming no candidate-city lookup occurs.

Changes

Return-route Seoul fallback

Layer / File(s) Summary
Fallback selection and validation
src/main/java/com/cotato/cokerthon/domain/route/service/ReturnRouteService.java, src/test/java/com/cotato/cokerthon/domain/route/service/ReturnRouteServiceTest.java
Adds the 15-minute fallback threshold to pickRandomCity and tests that a WEST 15-minute route saves Seoul without querying city candidates.

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

🚥 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 summarizes the main change: mapping small return gaps to Seoul.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 feat/return-route-small-gap-seoul

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

@ccjngwn
ccjngwn marked this pull request as ready for review July 10, 2026 19:07
@ccjngwn
ccjngwn merged commit 9f8b9d6 into develop Jul 10, 2026
4 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/test/java/com/cotato/cokerthon/domain/route/service/ReturnRouteServiceTest.java (1)

131-160: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add threshold boundary coverage.

This test validates WEST 15, but parameterized cases for -15 and 16 would also prove both-direction fallback and that candidate lookup resumes above the threshold.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/com/cotato/cokerthon/domain/route/service/ReturnRouteServiceTest.java`
around lines 131 - 160, Add parameterized boundary cases to
createReturnRouteMapsWest15MinutesToSeoulWithoutFindingCityCandidates (or
extract a shared parameterized test) covering gap values -15 and 16 in addition
to WEST 15. Assert -15 also falls back to the BASE/Seoul checkpoint without
candidate lookup, while 16 resumes
cityRepository.findAllByDirectionAndGapMinutes with the expected direction and
gap.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@src/test/java/com/cotato/cokerthon/domain/route/service/ReturnRouteServiceTest.java`:
- Around line 131-160: Add parameterized boundary cases to
createReturnRouteMapsWest15MinutesToSeoulWithoutFindingCityCandidates (or
extract a shared parameterized test) covering gap values -15 and 16 in addition
to WEST 15. Assert -15 also falls back to the BASE/Seoul checkpoint without
candidate lookup, while 16 resumes
cityRepository.findAllByDirectionAndGapMinutes with the expected direction and
gap.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f905509-49a7-4a82-bd75-4309ec6b4354

📥 Commits

Reviewing files that changed from the base of the PR and between 47aa53b and cea01df.

📒 Files selected for processing (2)
  • src/main/java/com/cotato/cokerthon/domain/route/service/ReturnRouteService.java
  • src/test/java/com/cotato/cokerthon/domain/route/service/ReturnRouteServiceTest.java

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant