Update planner, check-in records, location service and tests
AI Code Review / review (pull_request) Successful in 6m54s

This commit is contained in:
周瑞哲
2026-07-31 15:12:21 +08:00
parent 73664ca974
commit c0ed0048aa
11 changed files with 174 additions and 53 deletions
+17 -7
View File
@@ -15,6 +15,7 @@ import {
type PlanResponse,
resolveCanonicalPoiId,
type TravelPreferences,
TravelValidationError,
} from '../src/domain/travel'
import {
createPlan,
@@ -222,13 +223,22 @@ describe('deterministic local POC planner', () => {
})
it('rejects a quick plan when even the first stop cannot fit the budget', () => {
expect(() => createLocalPlan({
mode: 'quick',
preferences: preferences({ pace: 'relaxed', transport: 'walking' }),
durationMinutes: 120,
selectedPoiIds: [],
origin: { longitude: 114.3, latitude: 22.3, coordinateSystem: 'GCJ02' },
}, repository)).toThrow('没有可用于规划的地点')
let thrown: unknown
try {
createLocalPlan({
mode: 'quick',
preferences: preferences({ pace: 'relaxed', transport: 'walking' }),
durationMinutes: 120,
selectedPoiIds: [],
origin: { longitude: 114.3, latitude: 22.3, coordinateSystem: 'GCJ02' },
}, repository)
}
catch (error) {
thrown = error
}
expect(thrown).toBeInstanceOf(TravelValidationError)
expect(thrown).toMatchObject({ code: 'quick_route_unreachable' })
})
it('returns the same route and canonical IDs for equivalent input', () => {